![]() |
|
Home | Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]() Website URL: www.atletikka.com
URL to page in question: http://www.atletikka.com/store/women...2900738910684/ 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) : ?> <div> <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'); ?> </div> </div> </div> <?php endif; ?> </div> </div> Thanks for your help... |
#2
|
||||
|
||||
![]() Hi
I think this will work though you might have to tweak the value 250... In your Product Details view, change this: HTML Code:
<?php if ($product->saleprice > 0 && $product->saleprice < $product->price) : ?> <div> <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'); ?> </div> </div> </div> <?php endif; ?> HTML Code:
<?php $coupons = datafeedr_tag('Coupons?merchant='.$product->merchant.'&c=1456737'); ?> <?php if ( strlen( $coupons ) > 250 ) : ?> <div> <a class="fancybox" href="#test">Coupons</a> <div id="test" style="display:none;width:800px;"> <div id="view"> <?php echo $coupons; ?> </div> </div> </div> <?php endif; ?> Eric
__________________
![]() ![]() ![]() ![]() |
#3
|
|||
|
|||
![]() Great! That did the trick. Thank you! One quick question: When you say that...
Quote:
|
#4
|
|||
|
|||
![]() URL to page in question: http://www.atletikka.com/store/category/running/
I have one more question: When on a Category page, we want to have the same functionality with the coupons, but instead we want to show an icon on all those products whose Merchant has coupons. See link above to see where we are with this. So it would be pretty much the same concept as on the Product Detail Page, but this time on the Category Pages and with a Coupon Icon that will show up when that Merchant has Coupons and will open up the popup window when clicked. This is what we have so far: HTML Code:
<?php $coupons = datafeedr_tag('Coupons?merchant='.$product->merchant).'&c=1456737'; ?> <?php if ( strlen( $coupons ) > 250 ) : ?> <div class="sale-mask"> <a class="fancybox" href="#coupons">C</a> <div id="coupons" style="display:none;width:800px;"> <div id="view"> <?php echo $coupons; ?> </div> </div> </div> <?php endif; ?> |
#5
|
||||
|
||||
![]() It means if the number of characters returned by the datafeedr_tag() function is greater than 250, display the coupons. If it's less than 250, that probably means there are no coupons.
Quote:
The other issue is that you can't have more than 1 CSS ID per page. But you have id="coupons". That is the reason when you click the "C" link you only get Amazon coupons.... Amazon coupons are the first loaded on the page. You could try something like: HTML Code:
<?php $coupons = datafeedr_tag('Coupons?merchant='.$product->merchant).'&c=1456737'; ?> <?php $css_id = 'coupons-' . $product->merchant; ?> <?php if ( strlen( $coupons ) > 250 ) : ?> <div class="sale-mask"> <a class="fancybox" href="#<?php echo $css_id; ?>">C</a> <div id="<?php echo $css_id; ?>" style="display:none;width:800px;"> <div id="view"> <?php echo $coupons; ?> </div> </div> </div> <?php endif; ?> HTML Code:
<?php $coupons = datafeedr_tag('Coupons?merchant='.$product->merchant).'&c=1456737'; ?> <?php $css_id = 'coupons-' . $product->merchant . '-' . mt_rand(); ?> <?php if ( strlen( $coupons ) > 250 ) : ?> <div class="sale-mask"> <a class="fancybox" href="#<?php echo $css_id; ?>">C</a> <div id="<?php echo $css_id; ?>" style="display:none;width:800px;"> <div id="view"> <?php echo $coupons; ?> </div> </div> </div> <?php endif; ?> Eric
__________________
![]() ![]() ![]() ![]() |
#6
|
|||
|
|||
![]() URL to page in question: http://www.atletikka.com/store/searc...ike+reax+run+9
Hi Eric! Thank you so much for helping me resolve our issues. It works great now! Now I have one more request that has to do with the Comparison Sets. Now that the coupons popup window is working, we are adding a feature that when the product has a comparison set, it will show a tab next to the coupon tab inside the popup window called Compare. If you go to the page listed above, and click on one of the coupons button on one of the products that has a COMPARE button at the bottom, you'll see what we want to accomplish. So far we added an the IF () statement that when the product has a comparison set, it will add the Compare tab, and if it doesn't it will not. You can try this by clicking on the coupons button on another product that doesn't have the Compare button at the bottom and you'll see that the only tab that shows up is the Coupons tab. But now the situation is that when you click on the Compare tab, I was only able to get it to work with one compset_id, and not for the compset for that particular product. So that's where I need your help. I need the Compare tab to show the comparison set of the selected product. Here's the code that I have in place: HTML Code:
<div class="compare"> <?php if ( $product->compset_status > 0 ) : ?> [tabs][tab title="Coupons"]<?php echo $coupons; ?>[/tab] [tab title="Compare"][DFR:compset?compset_id=56261][/tab][/tabs] <?php else : ?> [tabs][tab title="Coupons"]<?php echo $coupons; ?>[/tab][/tabs] <?php endif; ?> </div> And one more question, which you've probably gotten many times: Is there a way to automate the comparison sets in any way? Or is there a way to make do the comparisons in an easier and faster way? Thanks in advance! |
#7
|
||||
|
||||
![]() Hi
You should be able to pass the product ID to the shortcode. Code:
[DFR:compset?p=1234567890987654321] That should build the compset based on the product. Unfortunately there's no way to automate comp sets. Eric
__________________
![]() ![]() ![]() ![]() |
#8
|
|||
|
|||
![]() Thank you
|
#9
|
|||
|
|||
![]() Hello Eric,
Can we create Comparison sets in bulk? Thanks. |
#10
|
|||
|
|||
![]() |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Coupons | globie | Questions | 4 | February 14th, 2014 03:11 AM |
Using Coupons | youngy | Questions | 2 | February 20th, 2013 08:37 AM |
Coupons | kargz12 | Problems | 4 | March 20th, 2012 12:22 PM |
Coupons? | lesljr | Questions | 2 | March 13th, 2012 04:11 PM |