You are here:  » Jump Id Remains Same


Jump Id Remains Same

Submitted by Rocket32 on Mon, 2014-08-11 02:47 in

Hello David. I had you assist me with the product jump id remaining the same on the original PT install. How do I incorporate the jump dupe hash into the wordpress plugin? I would like the jump urls to remain same for products from same merchants after imports. I have the installed /pt/ with the changes in http://www.pricetapestry.com/node/3056.

Currently jump is putting out an id & page is broken.

Submitted by support on Mon, 2014-08-11 09:43

Hi,

To make the corresponding changes in PriceTapestry.org for WordPress, edit pto_common.php and look for the following code at line 97:

  return $pto_config_externalBaseHREF."jump.php?id=".$product->id;

...and REPLACE with:

  return $pto_config_externalBaseHREF."jump.php?id=".$product->dupe_hash;

If making similar changes that I know you have made in your standalone version whereby links from search results with only one merchant go direct to Buy URL, then also in pto_search.php look for the following code at line 357:

  $sql2 = "SELECT id,name,normalised_name,image_url,description,price,rating FROM `".$pto_config_databaseTablePrefix."products` WHERE id IN (".$in.")";

...and REPLACE with:

  $sql2 = "SELECT id,name,normalised_name,image_url,description,price,rating,dupe_hash FROM `".$pto_config_databaseTablePrefix."products` WHERE id IN (".$in.")";

And then the following code at line 382:

  $pto_searchResults[$k]->rating = $rows3[$product->id]->rating;

...and REPLACE with:

  $pto_searchResults[$k]->rating = $rows3[$product->id]->rating;
  $pto_searchResults[$k]->dupe_hash = $rows3[$product->id]->dupe_hash;

And for related products (which uses search results templates), edit pto_product.php and look for the following code at line 230:

  $sql2 = "SELECT name,normalised_name,image_url,description,price,rating,MIN(price) AS minPrice, COUNT(id) AS numMerchants FROM `".$pto_config_databaseTablePrefix."products` WHERE name IN (".$in.") GROUP BY name";

...and REPLACE with:

  $sql2 = "SELECT name,normalised_name,image_url,description,price,rating,dupe_hash,MIN(price) AS minPrice, COUNT(id) AS numMerchants FROM `".$pto_config_databaseTablePrefix."products` WHERE name IN (".$in.") GROUP BY name";

And finally the following code at line 255:

  $pto_searchResults[$k]->rating = $rows3[$product->name]->rating;

...and REPLACE with:

  $pto_searchResults[$k]->rating = $rows3[$product->name]->rating;
  $pto_searchResults[$k]->dupe_hash = $rows3[$product->name]->dupe_hash;

Cheers,
David.
--
PriceTapestry.com