Support forum login

©2006-2008 IAAI Software

Contact Us

Anybody know how to point straight to the merchant, skipping the product info page?

Submitted by Harvey on Sun, 2006-08-20 20:56.

OK, first, I know this script has a *great* product compare page. I'll make use of it on other projects, I promise :)

Anyway, on the project I'm doing (where no product is the same), there's no point in this page, and it's better to minimise the number of clicks the user needs to make before he/she finds the product.

So, I'd like to skip out the very nice product info page and just go straight to the Buy URL.

I tried making the image and text href to "

<?php
 
print tapestry_buyURL($mainProduct); 
?>
", but that just links to the current page.

Anybody care to shed some light on this?

Thanks!

Submitted by dmorison on Sun, 2006-08-20 21:10.

Hi Harvey,

To make the links on the search results page go straight to the merchant, you need to make the change in search.php. Look for the following code (starting at Line 141):

      if ($config_useRewrite)
      {
        $searchresults["products"][$k]["productHREF"] = "product/".tapestry_hyphenate($product["name"]).".html";
        if ($rewrite) $searchresults["products"][$k]["productHREF"] = "../../".$searchresults["products"][$k]["productHREF"];
      }
      else
      {
        $searchresults["products"][$k]["productHREF"] = "products.php?q=".urlencode($product["name"]);
      }

You can change that simply to:

      $searchresults["products"][$k]["productHREF"] = tapestry_buyURL($product);

(you don't need the IF statement anymore because whether or not you are using search engine friendly URLs is irrelevant if you are going off-site!)

That should do the trick...

Cheers,
David.

Submitted by Harvey on Sun, 2006-08-20 21:23.

Worked like a dream.

Best script support in the world, although everything seems to have been already thought of!

Submitted by mally on Sun, 2008-05-11 23:08.

Hello David

Further to the question above.

Would it be possible to have both options.

E.g add a purchase link/button?

thanks

Mally

Submitted by dmorison on Mon, 2008-05-12 07:32.

Hi Mally,

Sure - in this case the mod would have to go in html/searchresults.php. Look for the following code on line 29:

<span class='nobr'><a href='<?php print $product["productHREF"]; ?>'><?php print translate("More Information"); ?></a></span>

...and change this as follows to add a "Visit Store" (or whatever you want to call it) link below the "More Information" link...

<span class='nobr'><a href='<?php print $product["productHREF"]; ?>'><?php print translate("More Information"); ?></a></span>
<span class='nobr'><a href='<?php print tapestry_buyURL($product); ?>'>Visit Store</a></span>

Cheers,
David.

--
Developer, Price Tapestry
For unrelated PHP, MySQL or Affiliate Marketing tech help please post your questions on my personal forum