Unknown end date

Unknown end date

July 17, 2018
Sofie Sofie
  • Sofie
    Sofie
    Senior Member 157 points

    Hello,

    Is it possible to add an option when there is no end date for a coupon? For example: when there is no date in the listing, the end date at the site will be blank (no text) or unknown (text)?

    Thanks,
    Sofie

    July 17, 2018 at 3:13 pm
  • JamesD
    JamesD
    Super Guru 918 points

    Hello ,

    If I’m understanding you correctly, yes. You can edit, or create, the custom ‘content-listing.php’ file.

    You can either add the contents of the attached file to your child theme directory (if you don’t have one yet)… or if the ‘content-listing.php’ file already exists in your child theme then do the following:
    Find ALL of these lines (around line #69 in content-listing.php)…

                      <?php if($vv['expired'] == 1){ ?>
                      <?php echo __("expired","premiumpress") ?>
                      <?php }else{ ?>

    And replace with:

                      <?php if($vv['expired'] == 1){ ?>
    <?php /**  Custom Change - 07/20/18
    	Set expired text if end date is possibly empty
    	- Replace CUSTOM_TEXT_HERE with the text to be displayed or make empty.
    */ ?>
    <?php $sExpiredText = trim($vv['string']) === '1 Days'?"CUSTOM_TEXT_HERE":"expired"; ?>
    <?php echo __($sExpiredText,"premiumpress") ?>
                      <?php }else{ ?>
    Attachments:
    You must be logged in to view attached files.
    July 20, 2018 at 9:18 pm
  • Sofie
    Sofie
    Senior Member 157 points

    Thank you very much, James. You are great :)

    July 23, 2018 at 6:36 pm
  • JamesD
    JamesD
    Super Guru 918 points

    You’re welcome Sofie, glad to help. :-)

    July 23, 2018 at 6:39 pm
  • Mark Fail
    Mark Fail
    Super Guru 12,697 points

    In the admin under configuration -> coupon settings -> SHOW EXPIRED COUPONS

    turn this on, this will save any code changes.

    July 24, 2018 at 7:00 am
Viewing 5 posts - 1 through 5 (of 5 total)

Didn't find what you were after?

Chat with us now

or contact our support team