LIMITED OFFER: Save $200 Today! - Get All Themes For $199 -- Learn More

Ask the community

This is a community support forum where you can ask
questions and interact with other PremiumPress Customers.

Hide expired coupons on homepage

  • Guido
    Guido
    Newbie 37 points
    July 17, 2013 at 9:15 pm

    Hi,

    I want the expired coupons to be available after expiry. Therefore I selected the option to move them to different category on expiry. That works, but then they still show up on the homepage (or the next pages). How can I remove them there, and only let them show in the Expired-tab in stores or search.

    Thanks!

  • Mark Fail
    Mark Fail
    Super Guru 12,885 points
    July 18, 2013 at 2:45 am

    its a tricky one since there isnt anyway to know they have expired using basic wordpess queries. You would need to customize the display code to hide or remove the expired coupons from display.

    functions file is found: PPT/class/class_design.php

  • Aaron
    Aaron
    Super Guru 922 points
    July 18, 2013 at 3:16 am

    Get your expired cat ID and add something like this to the query:
    cat=-144

    Where 144 is your expired cat ID.

  • Mark Fail
    Mark Fail
    Super Guru 12,885 points
    July 18, 2013 at 3:38 am

    thanks Aaron

  • Guido
    Guido
    Newbie 37 points
    July 19, 2013 at 3:00 pm

    Thanks guys.

    I found an option to exclude some cats @ General Display Options > Category, but that only works for the Category Block on the homepage. The file class_design.php has a lot of code.

    Am I looking for code in */ === VERSION 7 HOME PAGE OBJECTS === ?

    What do I need to change?

  • Guido
    Guido
    Newbie 37 points
    August 8, 2013 at 12:58 pm

    For anyone else who wants to do this:

    Change rule #2295 in class_design.php

    from:

    $GLOBALS[‘query_string_new’].=”&paged=”.$paged;

    to:

    $GLOBALS[‘query_string_new’].=”&paged=”.$paged”&cat=-XXXX”;

    where XXXX is the category ID you want to hide.

  • YAEL
    YAEL
    Newbie 18 points
    August 8, 2013 at 1:07 pm

    Thanks Guido

  • Mark Fail
    Mark Fail
    Super Guru 12,885 points
    August 8, 2013 at 1:44 pm

    thanks for sharing

  • scott
    scott
    Senior Member 247 points
    October 1, 2014 at 9:47 am

    How would I find the expired category ID?


  • Zhuoling
    Newbie 23 points
    February 21, 2017 at 11:06 pm

    I want to know where to find Expired voucher ID too.
    At meanwhile, I am thinking if there is a way to set function such as:
    if a voucher expiry time = 00:00:00, then the voucher should not display, I don’t know how to write a code to work for this, may be someone here can do…


  • Josh
    Super Guru 13,885 points
    February 22, 2017 at 12:56 pm

    Hello Zhuoling,
    Hover over the expired coupon and check left bottom corner of your screen to view listing/coupon id.Its also displayed just below the coupon title.See attached image

    Attachments:
    You must be logged in to view attached files.
  • Aaron
    Aaron
    Super Guru 922 points
    February 22, 2017 at 10:13 pm

    Category and Coupon/voucher ID are different.

    If you are not going to display the coupon, why not just move it to draft – it’s built into the theme.

Viewing 12 posts - 1 through 12 (of 12 total)