You are here:  » Featured products outgoing link %BUY_URL%


Featured products outgoing link %BUY_URL%

Submitted by xslinx on Wed, 2012-09-26 13:35 in

Hello David,

Could you tell me how I can make the Featured products links into outgoing links.

I've tried changing

<a href='%PRODUCT_URL%'>%PRODUCT_NAME%</a>

into:

<a href='%BUY_URL%'>%PRODUCT_NAME%</a>

but that doesn't seem to work.

Hope you can help. Thanks in advance!

Best regards,
Jaimy

Submitted by support on Wed, 2012-09-26 13:47

Hello Jaimy,

%BUY_URL% isn't supported as a placeholder in Featured Products / Each since Featured Products are generated from a summary SQL query; meaning that for any product that is compared (more than 1 merchant) the merchant / buy_url fields are not necessarily the cheapest merchant - which logically you would want to link to.

If your Featured Products are only ever going to be single merchant in your particular case then it's a single line modification - in pto_featured.php look for the following code at line 77:

        $each = str_replace("%PRODUCT_NAME%",$row->name,$each);

...and REPLACE with:

        $each = str_replace("%PRODUCT_NAME%",$row->name,$each);
        $each = str_replace("%BUY_URL%",pto_common_buyURL($row),$each);

...and with that in place your modificaiton to the template will work fine!

Cheers,
David.
--
PriceTapestry.com

Submitted by xslinx on Thu, 2012-09-27 09:00

Hi David,

That works perfectly, as always!
Thanks a lot!

Best regards,
Jaimy