Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hide product from cart until available date.. #2720

Merged
merged 19 commits into from
May 7, 2020

Commits on Aug 9, 2019

  1. Hide product from cart until available date..

    This additional/removable code offers an opportunity for a product
    to be fully defined in the store, but not shown as available,
    upcoming, new, etc (because it is disabled) until the product
    available date at which point it appears in the store as an
    enabled product ready for the customer to see and/or purchase.
    mc12345678 committed Aug 9, 2019
    Configuration menu
    Copy the full SHA
    f649880 View commit details
    Browse the repository at this point in the history

Commits on Jan 17, 2020

  1. Configuration menu
    Copy the full SHA
    5fefa7e View commit details
    Browse the repository at this point in the history
  2. Delete separate functions file

    These functions were moved into products_functions by discussion/request in zencart#2720.
    mc12345678 committed Jan 17, 2020
    Configuration menu
    Copy the full SHA
    413f69c View commit details
    Browse the repository at this point in the history
  3. Incorporate functions_products and enabling disabled product

    Ensures loading of `functions_products.php` and enables disabled product that were marked as having a future products_available_date where the current date is equal or beyond the date it was to become available.
    mc12345678 committed Jan 17, 2020
    Configuration menu
    Copy the full SHA
    f2ab47e View commit details
    Browse the repository at this point in the history
  4. Replaced load of code by alternate incorporation

    As requested in zencart#2720, the call to the functions to enable disabled product was moved into: `includes/init_includes/init_special_funcs.php` which eliminated the need for loading `includes/init_includes/init_special_funcs_disabled_upcoming.php` and therefore eliminated the need for this separate config file.
    mc12345678 committed Jan 17, 2020
    Configuration menu
    Copy the full SHA
    7833f89 View commit details
    Browse the repository at this point in the history
  5. Complete the removal of the additional files

    This functionality was moved into `includes/init_includes/init_special_funcs.php` as discussed in zencart#2720.
    mc12345678 committed Jan 17, 2020
    Configuration menu
    Copy the full SHA
    763ec19 View commit details
    Browse the repository at this point in the history
  6. Add control if admin switch present and enabled

    Allow the enablement of product that have a historical product_available_date if the constant is defined and set to support enablement of this feature.
    
    Consideration was given for testing/checking against `!= '0'`; however, seems that such an option would only be necessary to support some sort of third, fourth, etc... condition which is not clear what it may be and therefore likely would require modification of this area of the code if generated.  By the check specifically against `== '1'`, whatever defines it (file or database) if it is equal to 1 then this area of code will execute.
    
    Alternatively, for those that do mass installations, if they choose not to include the option in the database or choose to remove it, then code will continue to operate without execution of this feature.
    mc12345678 committed Jan 17, 2020
    Configuration menu
    Copy the full SHA
    059856a View commit details
    Browse the repository at this point in the history
  7. Remove closing php tag

    mc12345678 committed Jan 17, 2020
    Configuration menu
    Copy the full SHA
    1c83de7 View commit details
    Browse the repository at this point in the history
  8. Refactor for spaces/PSR-2

    Made spacing of 4 spaces and removed parentheses around require/require_once calls.  Also corrected an issue with the earlier incorporation of `functions_products` where the closing parenthesis was omitted.
    mc12345678 committed Jan 17, 2020
    Configuration menu
    Copy the full SHA
    bb53a3e View commit details
    Browse the repository at this point in the history
  9. Add enabled disabled date available configuration to update path

    Adds the admin control for enabling the feature to enable product that are in the disabled status and has a `products_available_date` in the database that has come to be or has passed.
    Default set to `0` to allow store owners to enable this feature potentially after a review of the database/product.  This is to prevent the sudden appearance of disabled product that happened to have a date entered in the `products_available_date` field.
    mc12345678 committed Jan 17, 2020
    Configuration menu
    Copy the full SHA
    5a40a93 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    0bb4855 View commit details
    Browse the repository at this point in the history
  11. Remove unnecessary parentheses in query

    Although original code had been adapted from other similar (but more complex) queries, the additional parentheses are unnecessary and I believe this was pointed out in earlier code review.
    mc12345678 committed Jan 17, 2020
    Configuration menu
    Copy the full SHA
    3035242 View commit details
    Browse the repository at this point in the history
  12. Use foreach for record traversal

    Use `foreach` instead of the older combination of `while (!$variable->EOF)` with `$variable->MoveNext()`
    This also eliminated the need to check for the number of records returned.
    mc12345678 committed Jan 17, 2020
    Configuration menu
    Copy the full SHA
    5352a55 View commit details
    Browse the repository at this point in the history

Commits on Jan 21, 2020

  1. Update configuration_title and configuration_description

    As requested in the PR discussion, updated the `configuration_title` and `configuration_description` to try to provide an improved explanation of what this feature does.
    
    Note, that as a result of working through this explanation, identified that enablement occurs without consideration of stock quantity or any other potential reason one may wish the product to remain disabled.  This is a further reason why the default is for this feature to be off upon install/upgrade so that consideration may be given to data modification and/or the desire to turn it on.
    mc12345678 committed Jan 21, 2020
    Configuration menu
    Copy the full SHA
    5c248b1 View commit details
    Browse the repository at this point in the history
  2. Update configuration_title and configuration_description

    As requested in the PR discussion, updated the `configuration_title` and `configuration_description` to try to provide an improved explanation of what this feature does.
    
    Note, that as a result of working through this explanation, identified that enablement occurs without consideration of stock quantity or any other potential reason one may wish the product to remain disabled.  This is a further reason why the default is for this feature to be off upon install/upgrade so that consideration may be given to data modification and/or the desire to turn it on.
    mc12345678 committed Jan 21, 2020
    Configuration menu
    Copy the full SHA
    79d9fe2 View commit details
    Browse the repository at this point in the history

Commits on Apr 27, 2020

  1. Default/Restore date to NULL and ignore if is NULL

    In preparation for future updates to the date/time processing
    to use NULL instead of the historical default of `'0001-01-01 00:00:00'`
    choosing to use NULL instead which is supported by the field.
    
    This reduces one change to the overall system.  Check for whether
    to process the record still compares against `'0001-01-01'`
    in the event other "systems" clear the field to be appear as
    empty.
    mc12345678 committed Apr 27, 2020
    Configuration menu
    Copy the full SHA
    88770fd View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    fbc7954 View commit details
    Browse the repository at this point in the history
  3. Update the installation and upgrade scripts for Automatic and Manual

    For new installation (not using a previous database), set this to
    automatic to enable product that are disabled and have a future
    date.  For upgrades left this as Manual so that a database update
    will not automatically enable product that were disabled but had
    a future date.
    
    Previous operation without this additional feature would have
    left the product disabled from viewing on the store until the
    product were enabled.
    mc12345678 committed Apr 27, 2020
    Configuration menu
    Copy the full SHA
    3fecb58 View commit details
    Browse the repository at this point in the history

Commits on May 7, 2020

  1. Formatting only

    drbyte committed May 7, 2020
    Configuration menu
    Copy the full SHA
    0fd163c View commit details
    Browse the repository at this point in the history