Thread: Date Available

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

    red flag Re: Date Available

    Quote Originally Posted by mc12345678 View Post
    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.
    I want the add to cart button to 'go live' once the date has been met.

    Currently people can still add to the cart before the date has been met and I don't want this to happen.

    I am not sure, I think 1.5.7 already has this feature implemented. However my client wants it working in 1.5.6c
    Nick Smith - Venture Design and Print
    https://venturedesignandprint.co.uk

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

    Default Re: Date Available

    Quote Originally Posted by Nick1973 View Post
    I want the add to cart button to 'go live' once the date has been met.

    Currently people can still add to the cart before the date has been met and I don't want this to happen.

    I am not sure, I think 1.5.7 already has this feature implemented. However my client wants it working in 1.5.6c
    The new 1.5.7 feature is about halfway between what I think is requested and what currently happens. The new feature takes a product that has been turned off (hidden, disabled, however you know the idea) and turns it on when the available date is reached as identified by someone accessing the store side on/after that date. What that means is the "public" doesn't "know" that the product exists until the date arrives. This is different than the product being seen, but not yet purchaseable... Then there's the way things "easily" are which is to allow sales of the item before it's availability so long as the store "thinks" that there is a quantity of product remaining.

    There is/was a set of that code available to use against 1.5.6. If that still is what is desired, then can get the link(s) to all of that. Just need to do a little research and reference again.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

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

    red flag Re: Date Available

    Quote Originally Posted by mc12345678 View Post
    The new 1.5.7 feature is about halfway between what I think is requested and what currently happens. The new feature takes a product that has been turned off (hidden, disabled, however you know the idea) and turns it on when the available date is reached as identified by someone accessing the store side on/after that date. What that means is the "public" doesn't "know" that the product exists until the date arrives. This is different than the product being seen, but not yet purchaseable... Then there's the way things "easily" are which is to allow sales of the item before it's availability so long as the store "thinks" that there is a quantity of product remaining.

    There is/was a set of that code available to use against 1.5.6. If that still is what is desired, then can get the link(s) to all of that. Just need to do a little research and reference again.
    Ok so does this leave the product seen before the date is met but stop it from being purchased or does it only make the product go live on the date being met?

    Send me the links anyway as I might be able to do something with it.
    Nick Smith - Venture Design and Print
    https://venturedesignandprint.co.uk

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

    Default Re: Date Available

    Quote Originally Posted by Nick1973 View Post
    Ok so does this leave the product seen before the date is met but stop it from being purchased or does it only make the product go live on the date being met?

    Send me the links anyway as I might be able to do something with it.
    Product behavior is off/hidden/disabled until available date. Ie. Is not available to the store customers for viewing or purchase until that date and then voila it is present and "fully" available.

    That said, there is swguy's post above also "describing" how to do what is requested here.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

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

    Default Re: Date Available

    Another alternative that unfortunately has been made a little more difficult to make happen/work is to generate the product as a product, then change the products_type to a document_general product which doesn't allow adding to the cart and then using a variation of the code for ZC 1.5.7 to have the products_type change back to a product on the available date....

    Reason it is a little harder to "manage" is that some point in recent version(s) many of the text fields associated with "adding" a product to the cart have been eliminated from the admin display because historically that product type is defaulted to not be added to the cart... To drive that point home, if you can't add a product to the cart, then how can you have a quantity of the product? Unfortunately what that means is that another means to achieve "similar" results ends up needing to exist (or be developed) instead of being able to take advantage of a "formality".
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

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

    Default Re: Date Available

    The "backwards" compatible version of the code I've been referring to can be found at: https://github.com/zencart/zencart/p...588c327c47d77e

    With a little "finagling", could modify it to change the products_type of a product based on a date passing and the products_type currently being say the document general product type (assuming that in current/recent versions that the original data is retained from when it was "converted" to that product type and possibly any edits made to it...)
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  7. #17
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    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.)
    I agree. This allow-add-to-cart function is probably the right place to do it.
    Perhaps even adding a custom Notifier hook here would let you extract your custom logic to someplace else.

    I was thinking maybe you could use a special trigger for the date-available date: eg: set the datetime to end in :58, and then in your function check if it ends in :58 return N regardless of the other conditions normally checked. Food for thought: at least that way it wouldn't require a db schema change.

    While the product-type swapping could work too, I worry that it might create confusion admin-side, and might create some SEO confusion with URL differences caused by the different type_handler page names.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  8. #18
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Date Available

    This is the sort of Notifier I was thinking of:
    https://github.com/zencart/zencart/pull/3698/files
    (and also requires: https://github.com/zencart/zencart/pull/3699/files )
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

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

    red flag Re: Date Available

    Quote Originally Posted by DrByte View Post
    This is the sort of Notifier I was thinking of:
    https://github.com/zencart/zencart/pull/3698/files
    (and also requires: https://github.com/zencart/zencart/pull/3699/files )
    Ok let me play with this code and see if it works well enough to do what I need to do.
    Nick Smith - Venture Design and Print
    https://venturedesignandprint.co.uk

 

 
Page 2 of 2 FirstFirst 12

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