Hi David
I want to add a list of products using the search external script as shown here:
http://www.childrensrooms.org.uk/peppa-pig-bedding/
However, I want the link to go direct to the merchant and also open in a new window.
I have found similar solutions in previous posts but I think some of the scripts have been updated since?
Thanks
Darren
Cheers David
That works a treat - is it possible for the link to open a new window also?
Thanks
Hi Darren,
The links themselves are actually created in html/searchresults.php, which is shared with the main Price Tapestry installation.
If you don't mind links opening in a new window from the main Price Tapestry site (it may not be a problem if your users are never even using it and you are using the external scripts exclusively), then you can simply open that file into your text editor and do a global Search and Replace of:
<a href
...with:
<a target='_BLANK' href
If, on the other hand, you only want links opening in a new window for results from searchExternal.php then the easiest thing to do is to make a copy of html/searchresults.php and call it something like html/searchresultsexternal.php. Then, edit searchExternal.php and replace line 282 with:
if (isset($searchresults)) require($common_path."html/searchresultsexternal.php");
Cheers,
David.
Thanks. Option A is ideal for what I want now and Option B is ideal for when I develop the site further.
Cheers
Darren
There is an SEO aspect to this change. An example of a site that USED to have product pages for everything but now directs visitors directly to merchant on search results pages is shopzilla.com. Google took notice of this too and now only lists roughly 13,500 pages when it used to be several hundred thousand. Those product pages, if made unique somehow (reviews, other features) can bring in a lot of natural search traffic. If the DON'T... switching to direct to merchant settings makes sense. shopzilla has a high pagerank from links obtained over a long period of time and so it can get away with this more easily than a new site.
I've been using the searchExternal script with success. But I wanted to add both the link to the product (kind of like a read more about this product) and a link directly to the merchant page in the search results. I have modified the code to link directly to the merchant, but I do not know how to add the proper code to link to the product or even if this is possible.
Hi,
This can be entirely implemented within html/searchresults.php - the script should already be generating the More Information / Compare Prices links, so to add the direct to cheapest merchant link above these, in that file look for the following code at line 24:
<?php if ($product["numMerchants"] > 1): ?>
...and REPLACE that with:
<?php print "<a href='".tapestry_buyURL($product)."'>Visit Store</a><br />"; ?>
<?php if ($product["numMerchants"] > 1): ?>
Hope this helps!
Cheers,
David.
--
PriceTapestry.com
Hi Darren,
No problem - in searchExternal.php, you'll find where the product link is created with the following code starting at line 271:
if ($config_useRewrite)
{
$searchresults["products"][$k]["productHREF"] = $config_baseHREF."product/".tapestry_hyphenate($product["normalised_name"]).".html";
}
else
{
$searchresults["products"][$k]["productHREF"] = $config_baseHREF."products.php?q=".urlencode($product["normalised_name"]);
}
To link directly to merchant, simply REPLACE all the above with just:
$searchresults["products"][$k]["productHREF"] = tapestry_buyURL($product);
Cheers,
David.