Datafeedr Support Forums  

Go Back   Datafeedr Support Forums > Current Version (V3) Forum > Questions
Home Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Important - The support forums are now in "read-only" mode as we transition to an alternative help desk solution. Feel free to contact us here with any of your questions or search the forums for an existing solution.
 
 
Thread Tools Search this Thread Display Modes
  #1  
Old June 2nd, 2011, 07:04 AM
badnews badnews is offline
 
Join Date: Apr 2011
Posts: 31
Question Coupon Ends (if exists)?

Is it possible to query coupon end date similar to the function for "Sale Price (if exists)" within product tags when editing a view in the factory?

Where exactly can one find this information to create their own php based arguments?

Thanks
  #2  
Old June 2nd, 2011, 07:07 AM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
 
Join Date: Feb 2008
Posts: 16,902
Default

Hi

Right now, there is no support for conditionals for coupon information. We plan on adding that in version 3.4.

Eric
  #3  
Old June 2nd, 2011, 07:10 AM
badnews badnews is offline
 
Join Date: Apr 2011
Posts: 31
Default

Looking forward to it. Thanks for the super fast reply Eric.
  #4  
Old February 7th, 2012, 05:29 PM
badnews badnews is offline
 
Join Date: Apr 2011
Posts: 31
Default

Alright. So how do i do it now .
  #5  
Old February 7th, 2012, 07:01 PM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
 
Join Date: Feb 2008
Posts: 16,902
Default

Hi

You have access to the following variables within a Product detail or Product list module:

PHP Code:
$s->coupon_info($product'code');
$s->coupon_info($product'begin');
$s->coupon_info($product'end');
$s->coupon_info($product'restrictions'); 
Those are coupon code, coupon begin date, coupon end date and any coupon restrictions.

You can use those values in your own PHP conditionals.

Eric
  #6  
Old February 7th, 2012, 07:02 PM
badnews badnews is offline
 
Join Date: Apr 2011
Posts: 31
Default

Great. Thanks!
  #7  
Old June 6th, 2012, 01:19 PM
bkozlowski bkozlowski is offline
 
Join Date: Nov 2009
Posts: 73
Default

Hi Eric,

I think I found the right thread for what i'm trying to do, but don't know very much php to implement it.

I'd like to ONLY show the "Coupon Code:" if the cell is greater than NULL?

If this is possible how would this look and where would we put it?

Thanks.
  #8  
Old June 6th, 2012, 02:08 PM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
 
Join Date: Feb 2008
Posts: 16,902
Default

Hi

You can do something like this:

PHP Code:
<?php if (trim($s->coupon_info($product'code')) != '') : ?>
    [coupon.code]
<?php endif; ?>
  #9  
Old June 6th, 2012, 02:32 PM
bkozlowski bkozlowski is offline
 
Join Date: Nov 2009
Posts: 73
Default

Thanks, Where should I put this?
  #10  
Old June 6th, 2012, 02:33 PM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
 
Join Date: Feb 2008
Posts: 16,902
Default

Quote:
Originally Posted by bkozlowski View Post
Thanks, Where should I put this?
Wherever you want the code to appear in your Views.
  #11  
Old June 6th, 2012, 02:40 PM
bkozlowski bkozlowski is offline
 
Join Date: Nov 2009
Posts: 73
Default

Worked like a charm! Thanks for your help.
  #12  
Old June 7th, 2012, 09:43 AM
bkozlowski bkozlowski is offline
 
Join Date: Nov 2009
Posts: 73
Default

Is it possible to modify this code in the following way?

Only show the "Coupon Code" unless the value is Null, if the value is Null then display the "Coupon End Date", if this value is also Null then display nothing.

Thanks
  #13  
Old June 7th, 2012, 09:45 AM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
 
Join Date: Feb 2008
Posts: 16,902
Default

Sure, just extend the if() statement:

PHP Code:
<?php if (trim($s->coupon_info($product'code')) != '') : ?>
    [coupon.code]
<?php elseif (trim($s->coupon_info($product'end')) != '') : ?>
    [coupon.end]
<?php endif; ?>
  #14  
Old June 7th, 2012, 09:45 AM
bkozlowski bkozlowski is offline
 
Join Date: Nov 2009
Posts: 73
Default

Ohh, is it also possible to change the format of the end date? Ex: 06-01-2012
  #15  
Old June 7th, 2012, 09:49 AM
bkozlowski bkozlowski is offline
 
Join Date: Nov 2009
Posts: 73
Default

Nice, I just started a PHP class so I can figure this stuff out myself lol. Appreciate your help!
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Coupon Widget winsh Questions 1 March 17th, 2011 11:39 AM


All times are GMT -5. The time now is 08:28 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.