Remove/hide product based on date

Discussion in 'Troubleshooting' started by leetv, Oct 13, 2017.

  1. leetv

    leetv aMember Pro Customer

    Joined:
    Apr 30, 2016
    Messages:
    3
    How can I make it so a product is no longer available for sign-up.

    I.e. I want to enter a date on the product setup and after that date it is no longer shown/available for sign-up.

    Thanks

    Lee
  2. caesar

    caesar aMember Pro Developer Staff Member

    Joined:
    Oct 16, 2009
    Messages:
    1,682
    Hello Lee,

    I am afraid there is automatic ability to do it.
    You can just log in to admin interface at this date and disable this product.

    Best Regards.
  3. halmaclean

    halmaclean aMember Pro Customer

    Joined:
    Aug 30, 2013
    Messages:
    26
    You'd need to build a plugin, I think. This would need to list all your products and allow you to set a date for each that you want to expire. The plugin would need to use 'Cron' to run a script that checked the dates set and if it was on or after the date required, it would access the am_product table and change the 'is_disabled' flag from 0 to 1. The script may need to run daily (i.e. at midnight) rather than every minute of the day, and that will keep any load on your server caused from running Cron too frequently down to a minimum.

    You'd need to resolve how you manage products that have a 'lifetime' access that have already been paid for by a user, but that may or may not be an issue for you.

    I don't think it is too difficult a plugin to create - I'd ask the support team at CGI for a customisation and pay the price asked ;)

    Or do it manually!

Share This Page