You are here:  » Direct buy url link in search results image link?


Direct buy url link in search results image link?

Submitted by APZ215 on Wed, 2019-10-16 07:35 in

Hello David,

I would like to link the images from my search results direct to the exit buy url, instead to a product page.

I saw (node/5083) and used it for {link saved} but this option links all the search content (text/image/button).

- I would like to link the images from my search results direct to the exit buy url
- I would like to link the text and button from my search results to the productpage

Is this possible?

Greetings Arlo

Submitted by support on Wed, 2019-10-16 08:48

Hello Arlo,

Sure - in html/searchresults.php look for the image HTML (around line 19)

<a href='<?php print $product["productHREF"]; ?>'><img alt='<?php print translate("Image of"); ?> <?php print htmlspecialchars($product["name"],ENT_QUOTES,$config_charset); ?>' class='pt_sr_image' src='<?php print htmlspecialchars($product["image_url"],ENT_QUOTES,$config_charset); ?>' /></a>

...and just change the href to use tapestry_buyURL($product) instead of $product["productHREF"] e.g.

<a href='<?php print tapestry_buyURL($product); ?>'><img alt='<?php print translate("Image of"); ?> <?php print htmlspecialchars($product["name"],ENT_QUOTES,$config_charset); ?>' class='pt_sr_image' src='<?php print htmlspecialchars($product["image_url"],ENT_QUOTES,$config_charset); ?>' /></a>

Cheers,
David.
--
PriceTapestry.com

Submitted by APZ215 on Wed, 2019-10-16 08:58

Hallo David,

It works... that is easy to fix!

Thank you
Gracias
Merci
Grazie
Danke sehr
Bedankt

Greetings Arlo