You are here:  » Compared items going to same retailer

Support Forum



Compared items going to same retailer

Submitted by jonny5 on Wed, 2011-12-07 16:02 in

Hi David,

I have only just noticed that the product pages where there is more than one price, all the links point to only one retailer (i have a buynow graphic button).

Would you know how I could change this so they go to the correct retailer

cheers

Submitted by support on Wed, 2011-12-07 16:28

Hi Jonny,

Check the HTML that you made to display your Buy Now graphic button in html/prices.php and look for the call to tapestry_buyURL() around that point. If you find that it is:

tapestry_buyURL($mainProduct)

...change that to:

tapestry_buyURL($product)

That should be all it is;

Cheers,
David.
--
PriceTapestry.com

Submitted by jonny5 on Wed, 2011-12-07 19:19

cheers, you are perfectly correct as always, all sorted

cheers

Submitted by jonny5 on Thu, 2011-12-08 12:12

another quick on .

on the front page i have featuredExternal calling the featured.php so i have 6 items displayed.

when you click the product it shows several retailers prices, thats fine but back on the front page i also have a buynow button so what i want is if someone clicks the buynow button that they are taken straight to the cheapest price retailers page.

cheers

Submitted by support on Thu, 2011-12-08 12:28

hi Jonny,

What's happening there is that the Featured Products results are being generated by a summary query; so unless there is only 1 merchant the product record from which the ID field was selected by MySQL is undefined and may not (as you have discovered) be that of the cheapest merchant, even though the cheapest price is displayed.

This will require a separate exit script to requery the database for the cheapest merchant and redirect to that Buy URL. This can be created easily as follows. Start with a copy of jump.php and save it as cheapest.php.

In your new cheapest.php file, you will have the following code at line 4:

  $sql = "SELECT filename,buy_url FROM `".$config_databaseTablePrefix."products` WHERE id='".database_safe($_GET["id"])."'";

REPLACE that with:

  $sql = "SELECT name FROM `".$config_databaseTablePrefix."products` WHERE id='".database_safe($_GET["id"])."'";
  database_querySelect($sql,$rows);
  $product = $rows[0];
  $sql = "SELECT filename,buy_url FROM `".$config_databaseTablePrefix."products` WHERE name='".database_safe($product["name"])."' ORDER BY price ASC limit 1";

Then in your featured.php, look for where the &;t'a> link is generated in your Featured Products HTML and instead of

tapestry_buyURL($product)

use:

$config_baseHREF."cheapest.php?id=".$product["id"];

You may also want to add

Disallow: /cheapest.php

...to your robots.txt of course;

Cheers,
David.
--
PriceTapestry.com

Submitted by jonny5 on Thu, 2011-12-08 17:22

cheers, worked perfectly