You are here:  » Creating New Links in prices.php

Support Forum



Creating New Links in prices.php

Submitted by jbperkins on Thu, 2008-07-24 22:37 in

Hi David,

How do I create a link in prices.php that would link to a different page with coupon code or shipping info?

Something similar to the "Stockist" link (http://mysite.com/merchant/merchantsite.com/) but instead...

http://mysite.com/coupons/merchantsite.com/ or
http://mysite.com/shipping/merchantsite.com/

Thanks for your help,
Jay

Submitted by support on Fri, 2008-07-25 08:35

Hello Jay,

Within html/prices.php each price is displayed within a foreach loop that you can find beginning on line 9 as follows:

<?php foreach($prices["products"] as $product): ?>

After that point, and before the closing endforeach; (line 16) you can access the merchant name through the variable $product["merchant"]. As the script is in HTML mode at this point, all you need to do to generate links as above would be something like:

<a href='/coupons/<?php print $product["merchant"]; ?>/'>Coupons</a>

Cheers,
David.