You are here:  » Showing product.php with Amazon products only

Support Forum



Showing product.php with Amazon products only

Submitted by allanch on Wed, 2011-11-02 12:02 in

Hi David,

I hope all is well. I have a niche site where all products are mapped ($config_nicheMode = TRUE) and Amazon prices are integrated into the main prices table. Quite a few products are only available from Amazon and I was wondering if products.php can show Amazon items when no others exist in pt_products table from other retailers? Thanks.

Allan

Submitted by support on Wed, 2011-11-02 14:22

Hi Allan,

One method would be to create a "dummy" feed of those products so that they can be found by search and then suppress records from that feed in products.php.

To do this, create a basic feed, say dummy.txt containing for example

ProductName,BuyURL,Price
Blue Widget,http://www.example.com/,29.99
Red Widget,http://www.example.com/,59.99

(I would recommend using representative pricing)

Register and import this feed using the merchant name "dummy".

Next, in merchants.php look for the following code at line 6:

$sql = "SELECT DISTINCT(merchant) FROM `".$config_databaseTablePrefix."products` ORDER BY merchant";

...and REPLACE with:

$sql = "SELECT DISTINCT(merchant) FROM `".$config_databaseTablePrefix."products` WHERE merchant <> 'dummy' ORDER BY merchant";

Then in products.php look for the following code at line 58:

      usort($rows,"cmp");

...and REPLACE with:

      foreach($rows as $k => $v)
      {
        if ($v["merchant"]=="dummy") unset($rows[$k]);
      }
      usort($rows,"cmp");

Hope this helps!

Cheers,
David.
--
PriceTapestry.com

Submitted by allanch on Wed, 2011-11-02 14:36

Thanks David, I'll give this a shot asap.