Page 1 of 4 123 ... LastLast
Results 1 to 10 of 40
  1. #1
    Join Date
    Feb 2004
    Posts
    3
    Plugin Contributions
    0

    Default Setting products to expire at certain date

    I have seen plenty of posts concerning having products expire, but I cannot find a solution.

    We are setting up a site that only has promotions, so all products will expire monthly. New products will be uploaded via EasyPopulate and will be set active and expire 30 days later.

    Is something like this possible?

    I know there's the ability to do featured products, but we want to do this on a bulk scale (100+ at a time).
    Last edited by jlavetan; 21 Apr 2008 at 04:53 PM. Reason: addtional information

  2. #2
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,655
    Plugin Contributions
    25

    Default Re: Setting products to expire at certain date

    There would be several ways of approaching this - none of them ideal.

    The most simple but manual way would be to use EasyPopulate to set the product_status to 0 for products which have expired.

    Depending upon the number of products, you could put them in a hidden category where they wouldn't be seen normally, and then use banners to draw attention to them. Banners have expiry dates already built-in, so they would appear to disappear off the site when their expiry date passed, though somebody who knows (or guesses) the product ID would still be able to uncover them. This is probably only practical anyway for small numbers of products.

    Another, and more robust approach, would be to add a product expiry date to the database. And then amend the database queries to look not just at date available, but also at "date of expiry". However, you would also need to amend easy populate for it to also recognise the new field, or to amend the admin to be able to enter and maintain the new field .
    See and test drive Zen Cart's free templates at zencarttemplates.info

    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

  3. #3
    Join Date
    Aug 2005
    Location
    Southampton
    Posts
    80
    Plugin Contributions
    0

    Default Re: Setting products to expire at certain date

    I also have been searching for this and would love to know how you would go about coding this. I was looking at trying to corrupt the coding that is used for specials and see if i could make it fit. So far no success in including it in products_general.

    Anyone have any ideas and i would be very interested.

  4. #4
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    64,681
    Plugin Contributions
    6

    Default Re: Setting products to expire at certain date

    You would need to add a new field to the products table such as:
    products_date_expired

    These should be datetime fields with the default of NULL ...

    Then, in a similar manner to how banners are made to be disabled or stopped by date, this can done ...

    You have to be careful of the midnight hour, just like in the banners ...

    This would require updating the admin code for adding/updating products and those files do not have overrides so be sure you keep a copy of original data and your customizations ...

    If you have your coder's hat on ... are good to go ...

    If your eyes are glazing over about now, perhaps the Commercial Help wanted would help ...

    This is something on the list for a future release of Zen Cart ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.1]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...

  5. #5
    Join Date
    Sep 2004
    Location
    Australia
    Posts
    348
    Plugin Contributions
    0

    Default Re: Setting products to expire at certain date

    I really need this customization and I can't finish my site due to its nature without it.

    I have added a field named products_date_expires to my db.
    The settings for this field are as follows:

    field: products_date_expires
    type: datetime
    length/values:
    collation:
    attributes:
    null: yes
    default: null
    extra:
    primary:
    index:
    unique:
    ---: radio button on
    fulltxt:
    Comments:
    mime type:
    browser transformation:
    transformation options:

    Obviously I don't know much about dbs so I probably didn't add something I should have added or entered.

    The next step I am assuming would be to enter the define statement for this in its appropiate file which I think it is admin/includes/languages/english/products.php?

    From there on I have no more ideas, another hint would be nice please. I don't mind finding my way around but a map is always useful.

    I thought I'd look in the zen_specials table for a clue but so far I am blind to it.

    Thank you.

  6. #6
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,655
    Plugin Contributions
    25

    Default Re: Setting products to expire at certain date

    I don't think that the specials code is going to be a great deal of help to you. That filters what products are listed, but it sounds as though you actually need to turn off the expired products - which happily would be easier.

    For this the map would be:
    1. database change (the easy bit that you've already done)
    2. changes to admin code to maintain the expiry date (this is the trickiest bit and would probably require you to change the collect_info, preview_info and update_product scripts for the relevant product type, and possibly other scripts such as copy_to_confirm)
    3. write a database query to find and update products that are still active but have passed their expiry date and integrate it into a PHP script
    4. schedule a CRON job to schedule the update script.
    Although not advanced, this would require a reasonable grasp of PHP and SQL and a willingness to plod through some old, tables-laden code to find the right places to insert your changes. If you aren't a reasonably experienced developer, then Ajeh's advice about the commercial help wanted section of the forum, might be the most appropriate way to go.
    See and test drive Zen Cart's free templates at zencarttemplates.info

    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

  7. #7
    Join Date
    Sep 2004
    Location
    Australia
    Posts
    348
    Plugin Contributions
    0

    Default Re: Setting products to expire at certain date

    Thank you Kuroi, I'll look into the commercial help for it as I am definitely not that advanced at all. Maybe one day........

    Thank yuo.

  8. #8
    Join Date
    Aug 2005
    Location
    Southampton
    Posts
    80
    Plugin Contributions
    0

    Default Re: Setting products to expire at certain date

    Thanks Ajeh & Kuroi. I will have a go on my test site and post for the benefit of vivaraquel if I get there.

  9. #9
    Join Date
    Sep 2004
    Location
    Australia
    Posts
    348
    Plugin Contributions
    0

    Default Re: Setting products to expire at certain date

    Quote Originally Posted by SteveCollins View Post
    Thanks Ajeh & Kuroi. I will have a go on my test site and post for the benefit of vivaraquel if I get there.
    Thank you Steve Collins. I would appreciate that.

  10. #10
    Join Date
    Mar 2009
    Posts
    14
    Plugin Contributions
    2

    Default Re: Setting products to expire at certain date

    Here you have the mod complete to setup an expiry date for any product.
    It will diable automatically the product after the specified date.

    Ideal for ticket selling, events dates, workshops and events reservation, etc...

    You can globally disable this feature by going to: admin, product listing,Use product expire date featured, enable or disable.

    Language files are English, French and Dutch

    I do not know how to upload as a mod so I post the file here.

    You can see the mod in action at www.perfectino.fr/store under workshops

 

 
Page 1 of 4 123 ... LastLast

Similar Threads

  1. Replies: 3
    Last Post: 16 Jan 2008, 05:37 AM
  2. setting product date available
    By g1media in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 9 Jul 2007, 03:33 PM
  3. Expire product based on date?
    By andrea71 in forum Customization from the Admin
    Replies: 1
    Last Post: 23 May 2006, 04:07 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •