Page 1 of 4 123 ... LastLast
Results 1 to 10 of 36
  1. #1
    Join Date
    Feb 2009
    Posts
    861
    Plugin Contributions
    0

    Default Scheduling a new product release in the store

    From past tests, it seems like if I want to prepare to have a product to be released at a future date, I cannot really "hide" it; it will be shown in the store but not be available for purchase.

    Is there a way to NOT have the product visible at all, until the scheduled release date?

    For example, if I create my products ahead of time and want to schedule one release per week (say, I am going on vacation for a few weeks and won't be able to upload/release the products live), can I do that? Natively or with a module?

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

    Default Re: Scheduling a new release in the store

    I would think that could mirror the code in includes/init_includes/init_special_funcs.php and one of the associated functions like featured.php to inspect products with a products_available_date and the product is disabled to verify that if the products_available_date is > than 0001-01-01 and the product is disabled and the current date is greater than or equal to the available date to then set the status as enabled...

    Before enabling that code, would want to look through the data of the database to be sure that wouldn't be enabling a product that is intended to remain disabled.

    I don't know of any plugin that does this.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  3. #3
    Join Date
    Feb 2009
    Posts
    861
    Plugin Contributions
    0

    Default Re: Scheduling a new release in the store

    I think a simple module to do that would be welcome!!!

  4. #4
    Join Date
    Dec 2009
    Location
    Amersfoort, The Netherlands
    Posts
    2,846
    Plugin Contributions
    25

    Default Re: Scheduling a new release in the store

    Why not use the date available. I set in the future, the product will be enabled on that date.
    Quote Originally Posted by CaroleAs View Post
    I think a simple module to do that would be welcome!!!

  5. #5
    Join Date
    Feb 2009
    Posts
    861
    Plugin Contributions
    0

    Default Re: Scheduling a new release in the store

    As far as what I could do, it would SHOW the product, while it is not available for purchase. The image and description would still show. Unless I am doing it wrong.

  6. #6
    Join Date
    Dec 2009
    Location
    Amersfoort, The Netherlands
    Posts
    2,846
    Plugin Contributions
    25

    Default Re: Scheduling a new release in the store

    You're right. I was under the impression, that a product that became available would turn on on the given date, but it doesn't. But the logic for that can not be to difficult to implement.
    Quote Originally Posted by CaroleAs View Post
    As far as what I could do, it would SHOW the product, while it is not available for purchase. The image and description would still show. Unless I am doing it wrong.

  7. #7
    Join Date
    Feb 2009
    Posts
    861
    Plugin Contributions
    0

    Default Re: Scheduling a new release in the store

    You mean that a mod could be made? I would love that and I think other store owners would benefit from that too!

  8. #8
    Join Date
    Dec 2009
    Location
    Amersfoort, The Netherlands
    Posts
    2,846
    Plugin Contributions
    25

    Default Re: Scheduling a new release in the store

    Yes, that is what i meant . I''l see what i can do for you after the weekend.
    Quote Originally Posted by CaroleAs View Post
    You mean that a mod could be made? I would love that and I think other store owners would benefit from that too!

  9. #9
    Join Date
    Feb 2009
    Posts
    861
    Plugin Contributions
    0

    Default Re: Scheduling a new release in the store

    That would be great!

    I have a new product released every Friday night. My clients know, and sometimes, stalk the store, waiting for the release! Occasionally, I am ahead of the game and would love to schedule the release ahead (like Wednesday or Thursday), and not have to be at the computer on Friday night to release it, or schedule several weeks ahead. We can schedule emails, newsletters, Facebook posts. It is just time for our store to follow suit!

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

    Default Re: Scheduling a new release in the store

    Quote Originally Posted by CaroleAs View Post
    I think a simple module to do that would be welcome!!!
    New file:
    includes/init_includes/init_special_funcs_disabled_upcoming.php

    Code:
    <?php
    /**
     * @copyright 2018
     * @license http://www.zen-cart.com/License/2_0.txt GNU Public License V2.0
     * @author mc12345678
     **/
    
      if (!isset($_SESSION['today_is'])) {
        $_SESSION['today_is'] = date('Y-m-d');
      }
      if ($_SESSION['today_is'] != date('Y-m-d')) {
        $_SESSION['today_is'] = date('Y-m-d');
        $_SESSION['updateExpirations_upcoming'] = false;
      }
    
    
    if (!isset($_SESSION['updateExpirations_upcoming']) || $_SESSION['updateExpirations_upcoming'] !== true) {
      /**
       * require the disabled upcoming products functions, auto-enable disabled product.
       */
      require DIR_WS_FUNCTIONS . 'disabled_upcoming.php';
      zen_enable_disabled_upcoming();
    
    }
    new file:
    includes/functions/disabled_upcoming.php
    Code:
    <?php
    /**
     * disabled-upcoming products functions
     *
     * @copyright 2018
     * @license http://www.zen-cart.com/License/2_0.txt GNU Public License V2.0
     * @author mc12345678
     **/
    
      function zen_set_disabled_upcoming_status($products_id, $status) {
          $sql = "UPDATE " . TABLE_PRODUCTS . "
                SET products_status = " . (int)$status . ", products_date_available = '0001-01-01' WHERE products_id = " . (int)$products_id;
    
      return $GLOBALS['db']->Execute($sql);
      }
    
      function zen_enable_disabled_upcoming() {
    
      $date_range = time();
    
      $zc_disabled_upcoming_date = date('Ymd', $date_range);
    
      $disabled_upcoming_query = "SELECT products_id
                                               FROM " . TABLE_PRODUCTS . "
                                               WHERE products_status = 0
                                               AND ((products_date_available <= " . $zc_disabled_upcoming_date . "
                                               AND products_date_available != '0001-01-01'))
                                              ";
    
      $disabled_upcoming = $GLOBALS['db']->Execute($disabled_upcoming_query);
    
      if ($disabled_upcoming->RecordCount() > 0) {
        while (!disabled_upcoming->EOF) {
          zen_set_disabled_upcoming_status($disabled_upcoming->fields['products_id'], 1);
          $disabled_upcoming->MoveNext();
        }
      }
     }
    Then to initiate the above code (saved for last to tie it together), add the following new file:
    includes/auto_loaders/config.enable_disabled_upcoming.php

    Code:
    <?php
    /**
     * disabled-upcoming products auto_loader to execute the operations.
     *
     * @copyright 2018
     * @license http://www.zen-cart.com/License/2_0.txt GNU Public License V2.0
     * @author mc12345678
     **/
    /**
     *Load just before the other special functions that may include this product.
     */
    
    $autoLoadConfig[149][] = array(
                                          'autoType'=>'init_script',
                                          'loadFile'=>'init_special_funcs_disabled_upcoming.php',
                                         );
    Note, there is no "do this for this product, but not that product" type switch incorporated. Ie. any product that has a products_date_available that has passed will be so enabled and the products_date_available will be set/reset to 0001-01-01 as if it never had such a future date...
    Last edited by mc12345678; 14 Dec 2018 at 03:24 PM. Reason: Corrected use/spelling of products_date_available
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

 

 
Page 1 of 4 123 ... LastLast

Similar Threads

  1. v151 Time release or calendar/scheduling of a product? Possible?
    By mickyhulse in forum General Questions
    Replies: 7
    Last Post: 16 Apr 2014, 01:28 AM
  2. 2008 Roadmap comments
    By DrByte in forum Development Road Map
    Replies: 2
    Last Post: 29 Aug 2008, 11:33 PM
  3. Adding Product Type -- New Release
    By rush_woman in forum Setting Up Categories, Products, Attributes
    Replies: 3
    Last Post: 31 Jan 2007, 08:22 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