You are here:  » Showing number of compared merchants for mapped products


Showing number of compared merchants for mapped products

Submitted by support on Wed, 2013-01-16 12:41 in

Hi everyone,

If using shortcodes throughout your site to pull in price comparison tables, here's a simple mod that will let you keep an eye on the number of compared merchants for each product for which you are using a shortcode.

The mod is hooked into the Product Mapping configuration page. In admin/productsmap.php look for the following code at line 72:

      print "</td>";

...and REPLACE with:

      print "</td>";
      print "<td>";
      $sql2 = "SELECT COUNT(*) as numMerchants FROM `".$config_databaseTablePrefix."products` WHERE name='".database_safe($productmap["name"])."'";
      database_querySelect($sql2,$rows2);
      print $rows2[0]["numMerchants"];
      print "</td>";

This will display a new column on the Product Mapping home page showing the number of compared merchants for each product. As with using Product Mapping to override product fields, there is no need to have to specify alternatives - it can be left blank on the configuration page for the mapping if that aspect of Product Mapping is not required.

Cheers,
David
--
PriceTapestry.com