You are here:  » Pricing Problem

Support Forum



Pricing Problem

Submitted by biglion on Sun, 2009-08-16 00:52 in

One of my merchants has a $0.00 price in the price field for several hundred products while the price of the majority of products is correct. The actual price for the $0.00 products is contained in another field named "FIELD14".

How can I replace the $0.00 price with the price contained in "FIELD14"?

Submitted by support on Sun, 2009-08-16 11:29

Hi,

This would best patched in to the import record handler in includes/admin.php. In that file, look for the following code on line 168:

$record[$admin_importFeed["field_price"]] = tapestry_decimalise($record[$admin_importFeed["field_price"]]);

...and REPLACE that with:

$record[$admin_importFeed["field_price"]] = tapestry_decimalise($record[$admin_importFeed["field_price"]]);
if ($record[$admin_importFeed["field_price"]] == "0.00")
{
  $record[$admin_importFeed["field_price"]] = tapestry_decimalise($record["FIELD14"]);
}

Hope this helps!

Cheers,
David.

Submitted by biglion on Mon, 2009-08-17 16:18

That works fine but will that cause potential problems with other merchant feeds? It's only one merchant that causes the problem and if it happens in other merchant feeds, "FIELD14" will likely not even be a price field. Can I limit the mod to a single merchant while leaving the other merchants alone?

Submitted by support on Mon, 2009-08-17 16:46

Hi,

Sure you can - just wrap the merchant specific section of the above modification within an IF statement based on the merchant name, for example:

$record[$admin_importFeed["field_price"]] = tapestry_decimalise($record[$admin_importFeed["field_price"]]);
if ($admin_importFeed["merchant"]=="Merchant Name")
{
  if ($record[$admin_importFeed["field_price"]] == "0.00")
  {
    $record[$admin_importFeed["field_price"]] = tapestry_decimalise($record["FIELD14"]);
  }
}

(replacing Merchant Name with the exact name of the merchant with the zero prices...)

Cheers,
David.

Submitted by biglion on Tue, 2009-08-18 01:42

Perfect, thanks!