Guido

Hide expired coupons on homepage

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!

Created: July 17, 2013 at 9:15 pm
  • In: CouponPress
  • Started by: GuidoGuido
  • 7 members left 11 comments
  • Last reply from: AaronAaron

  • Mark Fail
    Mark Fail
    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/

  • Aaron
    Aaron
    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
    July 18, 2013 at 3:38 am

    thanks Aaron

  • Guido
    Guido
    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 has a lot of code.

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

    What do I need to change?

  • Guido
    Guido
    August 8, 2013 at 12:58 pm

    For anyone else who wants to do this:

    Change rule #2295 in

    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
    August 8, 2013 at 1:07 pm

    Thanks Guido

  • Mark Fail
    Mark Fail
    August 8, 2013 at 1:44 pm

    thanks for sharing

  • scott
    scott
    October 1, 2014 at 9:47 am

    How would I find the expired category ID?


  • Zhuoling
    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
    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 also displayed just below the coupon attached image

    Attachments:
    You must be a member to view attached files.
  • Aaron
    Aaron
    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)