View Single Post
Old January 21st, 2015, 11:05 AM
creativa creativa is offline
Join Date: Nov 2014
Posts: 12
Default PHP Conditionals for Coupons

Website URL:
URL to page in question:

Hi, I'm trying to set a PHP If() Conditional on the Product Detail Page where IF a Merchant is offering Coupons/Promotions, THEN a link will appear on page that when clicked, it will open up a window with the coupons available for that particular Merchant.

Right now, for the purpose of giving you an example, I have a PHP Conditional based on the Sale Price of the product. So, you'll notice that if a product is on sale, the word Coupon appears next to the price and that opens up the window with the available coupons. But when you click another product that is not on sale, you don't see the Coupons links anymore. So I want to do the same thing, but with the right PHP Conditionals.

This is the Code I have so far:

<?php if ($product->saleprice > 0 && $product->saleprice < $product->price) : ?>
<a class="fancybox" href="#test">Coupons</a>

<div id="test" style="display:none;width:800px;">
<div id="view">
<?php echo datafeedr_tag('Coupons?merchant='.$product->merchant.'&c=1456737'); ?>
<?php endif; ?>


Thanks for your help...