You are here:  » Do not import prices when 0.00

Support Forum



Do not import prices when 0.00

Submitted by allanch on Mon, 2011-09-05 11:14 in

Hi David,

I hope you're well. With reference to http://www.pricetapestry.com/node/2652 I'm trying to leave out prices that are 0.00 during import but I can't find the line where the code is supposed to be put in as my includes/admin.php has been modified. The only price related lines of code I can find are:

/* check product record for minimum required fields */
if (!$importRecord["name"] || !$importRecord["buy_url"] || !$importRecord["price"]) return;

and

/* decimalise price *
$importRecord["price"] = tapestry_decimalise($importRecord["price"]);
$importRecord["delivery_cost"] = tapestry_decimalise($importRecord["delivery_cost"]);
$importRecord["price"] = $importRecord["price"] + $importRecord["delivery_cost"];

Can you tell me how I can omit prices that are 0.00 during import. Thanks!

Submitted by support on Mon, 2011-09-05 12:10

Hi Allan,

Add the code around the decimalise price section. If you want to include delivery cost in the calculation then it would be:

/* decimalise price *
$importRecord["price"] = tapestry_decimalise($importRecord["price"]);
$importRecord["delivery_cost"] = tapestry_decimalise($importRecord["delivery_cost"]);
$importRecord["price"] = $importRecord["price"] + $importRecord["delivery_cost"];
if ($importRecord["price"]=="0.00") return;

However if you want to ignore delivery cost for the purposes of excluding 0.00 products, use:

/* decimalise price *
$importRecord["price"] = tapestry_decimalise($importRecord["price"]);
if ($importRecord["price"]=="0.00") return;
$importRecord["delivery_cost"] = tapestry_decimalise($importRecord["delivery_cost"]);
$importRecord["price"] = $importRecord["price"] + $importRecord["delivery_cost"];

Cheers,
David.
--
PriceTapestry.com

Submitted by allanch on Mon, 2011-09-05 13:31

Thanks David, all working now!