[thread moved from MagicParser.com, posted by getgood]
We have another script set up to handle ebay editor kits for our website and need to inlcude a text link underneath the 'Compare Prices' link to say something like 'Find on eBay' which will use the search query to link to our other search engine.
I have found where the 'Compare Prices' link is in Search.php but I cant figure out how to use the search variable to use with my other script.
We need to be able to have a link like this next to each product:
http://www.thebiggolfstore.com/ebay/search.cgi?keywords=[Product Name]
Any help much appreciated
At the point at which you want to generate your additional search link, the product information is in an associative array called $product. To access the product name; you need to use $product["name"]. The following code should do what you want, starting from the line containing the "Compare Prices" link:
<?php
/* ... rest of script ... */
print "<a href='".$productHREF."'>Compare Prices</a>";
/* ... add the following ... */
print "<br />";
$ebayHREF = "http://www.thebiggolfstore.com/ebay/search.cgi?keywords=".urlencode($product["name"]);
print "<a href='".$ebayHREF."'>Find on eBay</a>";
/* ... rest of script ... */
?>
Hope this helps!