Thread: Date Available

Page 1 of 2 12 LastLast
Results 1 to 10 of 19
  1. #1
    Join Date
    Sep 2008
    Location
    Cleethorpes
    Posts
    1,227
    Plugin Contributions
    6

    red flag Date Available

    [Note: remember to include site URL, ZC version, list of plugins, PHP version, etc ... read the Posting Tips shown above for information to include in your post here. And, remove this comment before actually posting!]

    How do I disable add to cart on products that have 'date available' set in the future please?
    Nick Smith - Venture Design and Print
    https://venturedesignandprint.co.uk

  2. #2
    Join Date
    Jul 2012
    Posts
    16,732
    Plugin Contributions
    17

    Default Re: Date Available

    If not mistaken, basically make the quantity 0 and allow the product to still be "active" or "enabled"... and/or and I apologize for the momentary lapse in memory, to have the add-to-cart button not visible for the product... I am/was thinking that was an option in the product information page... again, I apologize for attempting to answer without strict confidence...
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  3. #3
    Join Date
    Sep 2008
    Location
    Cleethorpes
    Posts
    1,227
    Plugin Contributions
    6

    red flag Re: Date Available

    Quote Originally Posted by mc12345678 View Post
    If not mistaken, basically make the quantity 0 and allow the product to still be "active" or "enabled"... and/or and I apologize for the momentary lapse in memory, to have the add-to-cart button not visible for the product... I am/was thinking that was an option in the product information page... again, I apologize for attempting to answer without strict confidence...
    When you set a product to be available in the future the add to cart button is still there and the product can be added to the cart. If you set the product to zero quantity then the add to cart button does not appear. However what if there are many products that are set up with Date available in the future and there is little time to edit lots of quantities? Ideally I need date available to make the add to cart button disappear without editing quantities.
    Nick Smith - Venture Design and Print
    https://venturedesignandprint.co.uk

  4. #4
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    9,683
    Plugin Contributions
    123

    Default Re: Date Available

    You could customize zen_get_products_allow_add_to_cart() to return 'N' if the available date is non-blank and in the future.
    (See zen_get_new_date_range() for logic that does this.)

    For some reason, I too thought this was built-in but it doesn't appear to be. Someday maybe.
    Last edited by swguy; 20 Jun 2020 at 09:48 AM.
    That Software Guy. My Store: Zen Cart Modifications
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

  5. #5
    Join Date
    Sep 2008
    Location
    Cleethorpes
    Posts
    1,227
    Plugin Contributions
    6

    Default Re: Date Available

    Quote Originally Posted by swguy View Post
    You could customize zen_get_products_allow_add_to_cart() to return 'N' if the available date is non-blank and in the future.
    (See zen_get_new_date_range() for logic that does this.)

    For some reason, I too thought this was built-in but it doesn't appear to be. Someday maybe.
    It only came to light because a client notified me of it. I can understand why some people may want people to order products in advance. So it would be better to have a switch in the admin probably under Configuration > Product Info to switch 'Allow add to cart' on or off if date available is in the future. That would get around having to edit every product if the date available is in the future, and add to cart would only come live on the date set on the product.
    Nick Smith - Venture Design and Print
    https://venturedesignandprint.co.uk

  6. #6
    Join Date
    Jul 2012
    Posts
    16,732
    Plugin Contributions
    17

    Default Re: Date Available

    Quote Originally Posted by Nick1973 View Post
    It only came to light because a client notified me of it. I can understand why some people may want people to order products in advance. So it would be better to have a switch in the admin probably under Configuration > Product Info to switch 'Allow add to cart' on or off if date available is in the future. That would get around having to edit every product if the date available is in the future, and add to cart would only come live on the date set on the product.
    For ZC 1.5.7, there is a variation of this where the product is completely hidden until the available date by setting the product to disabled, having a future available date, and having a setting enabled in the admin to automatically make that switch.

    See this PR: https://github.com/zencart/zencart/pull/2720/files
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  7. #7
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    9,683
    Plugin Contributions
    123

    Default Re: Date Available

    Right, but many people do not want the product to be hidden, they just want purchases disabled. That's what the OP is asking for.
    That Software Guy. My Store: Zen Cart Modifications
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

  8. #8
    Join Date
    Jul 2012
    Posts
    16,732
    Plugin Contributions
    17

    Default Re: Date Available

    Quote Originally Posted by swguy View Post
    Right, but many people do not want the product to be hidden, they just want purchases disabled. That's what the OP is asking for.
    Oh I understand/understood what was asked for. Providing some suggestions and information about other alternatives, whether now or in the near future. I mean I'm surprised no one has offered/suggested ways to make the "large number" of changes in a quick manner? Not sure how much time is needed/perceived, but I think within 30 minutes or so all of these future product could be put into a condition that met the original design of the cart (not require code modification) and to include a basic "backup" of the current condition of the database. It would have at least addressed the immediate need while other action was taken.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  9. #9
    Join Date
    Sep 2008
    Location
    Cleethorpes
    Posts
    1,227
    Plugin Contributions
    6

    Default Date Available

    How can I stop a product on date available being added to the cart? (It still allows add to cart before the date it becomes available)
    Nick Smith - Venture Design and Print
    https://venturedesignandprint.co.uk

  10. #10
    Join Date
    Jul 2012
    Posts
    16,732
    Plugin Contributions
    17

    Default Re: Date Available

    Quote Originally Posted by Nick1973 View Post
    How can I stop a product on date available being added to the cart? (It still allows add to cart before the date it becomes available)
    Are you wanting the product never to be added to the cart or only when the date available has been met? The discussion doesn't seem so clear.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Date Available Product
    By IRTech in forum Customization from the Admin
    Replies: 2
    Last Post: 31 Aug 2011, 10:01 PM
  2. Date Available
    By tsrplatelayer in forum General Questions
    Replies: 0
    Last Post: 5 May 2011, 07:50 PM
  3. Replies: 3
    Last Post: 30 Sep 2010, 11:23 PM

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
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR