Page 1 of 2 12 LastLast
Results 1 to 10 of 17
  1. #1
    Join Date
    May 2014
    Location
    UK
    Posts
    317
    Plugin Contributions
    0

    Default Products Available Date

    Hi

    We have been using the products available date to display forthcoming books soon to be released.

    Problem is we are sure that one was set with a due date of 9th June and this morning it has gone from the list. Does the system automatically remove these dates once they are passed? I wouldn't have thought so but now I'm not so sure.

    I've even looked in PHP Admin and sorted on product_expected and only the 8 that show on the site are there with a date.

  2. #2
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Products Available Date

    Yes, once the Available Date has happened then the date is removed from the Product record ...
    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!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  3. #3
    Join Date
    May 2014
    Location
    UK
    Posts
    317
    Plugin Contributions
    0

    Default Re: Products Available Date

    Quote Originally Posted by Ajeh View Post
    Yes, once the Available Date has happened then the date is removed from the Product record ...
    Oh how annoying!!! We're using it as a Product Expected date rather than a Product Available date ..... going to have to rethink this then

  4. #4
    Join Date
    May 2014
    Location
    UK
    Posts
    317
    Plugin Contributions
    0

    Default Re: Products Available Date

    Would anybody happen to know where the code for this automatic date removal sits please? We would like to keep product available even past the date specified if we cannot locate it.

    Thanks

  5. #5
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Products Available Date

    Check first that the fieldname is:
    products_date_available

    vs what you have posted:
    product_expected
    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!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  6. #6
    Join Date
    May 2014
    Location
    UK
    Posts
    317
    Plugin Contributions
    0

    Default Re: Products Available Date

    Quote Originally Posted by Ajeh View Post
    Check first that the fieldname is:
    products_date_available

    vs what you have posted:
    product_expected
    Hi AJeh

    Yes thanks - I did that work bit out ... just trying to find where it erases the products_data_available field in the database

  7. #7
    Join Date
    May 2014
    Location
    UK
    Posts
    317
    Plugin Contributions
    0

    Default Re: Products Available Date

    Think I may have it:

    In Admin/products_expected.php

    I have commented out the following:

    // $db->Execute("update " . TABLE_PRODUCTS . "
    // set products_date_available = NULL
    // where to_days(now()) > to_days(products_date_available)");


    Should see tomorrow if that does the trick as I have set up a dummy product available tomorrow

  8. #8
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Products Available Date

    You have two files to customize if you NEVER want the products_date_available to change except when you manually change it ...
    /your_secret_admin/includes/modules/update_product.php

    comment out the line that removes it when in the Admin:
    Code:
      } elseif ($_POST['products_model'] . $_POST['products_url'] . $_POST['products_name'] . $_POST['products_description'] != '') {
        $products_date_available = zen_db_prepare_input($_POST['products_date_available']);
    //    $products_date_available = (date('Y-m-d') < $products_date_available) ? $products_date_available : 'null';
        // Data-cleaning to prevent MySQL5 data-type mismatch errors:
    then in the Catalog, you need to change the date filter so ALL dates are valid unless blank by commenting the old method and adding a new date range that will force it to always be valid when not blank ...
    /includes/functions/functions_lookups.php
    Code:
    // build date range for upcoming products
      function zen_get_upcoming_date_range() {
        // 120 days; 24 hours; 60 mins; 60secs
        $date_range = time();
        $zc_new_date = date('Ymd', $date_range);
    // need to check speed on this for larger sites
    //    $new_range = ' and date_format(p.products_date_available, \'%Y%m%d\') >' . $zc_new_date;
    //    $new_range = ' and p.products_date_available >' . $zc_new_date . '235959';
    $new_range = ' and p.products_date_available > "2000-01-01"';
        return $new_range;
      }
    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!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  9. #9
    Join Date
    May 2014
    Location
    UK
    Posts
    317
    Plugin Contributions
    0

    Default Re: Products Available Date

    Quote Originally Posted by Ajeh View Post
    You have two files to customize if you NEVER want the products_date_available to change except when you manually change it ...
    /your_secret_admin/includes/modules/update_product.php

    comment out the line that removes it when in the Admin:
    Code:
      } elseif ($_POST['products_model'] . $_POST['products_url'] . $_POST['products_name'] . $_POST['products_description'] != '') {
        $products_date_available = zen_db_prepare_input($_POST['products_date_available']);
    //    $products_date_available = (date('Y-m-d') < $products_date_available) ? $products_date_available : 'null';
        // Data-cleaning to prevent MySQL5 data-type mismatch errors:
    then in the Catalog, you need to change the date filter so ALL dates are valid unless blank by commenting the old method and adding a new date range that will force it to always be valid when not blank ...
    /includes/functions/functions_lookups.php
    Code:
    // build date range for upcoming products
      function zen_get_upcoming_date_range() {
        // 120 days; 24 hours; 60 mins; 60secs
        $date_range = time();
        $zc_new_date = date('Ymd', $date_range);
    // need to check speed on this for larger sites
    //    $new_range = ' and date_format(p.products_date_available, \'%Y%m%d\') >' . $zc_new_date;
    //    $new_range = ' and p.products_date_available >' . $zc_new_date . '235959';
    $new_range = ' and p.products_date_available > "2000-01-01"';
        return $new_range;
      }
    You'r a star thank you .. I will get these changed :)

  10. #10
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Products Available Date

    You are most welcome ...

    Remember, you will have to remove the date manually when you want it to go away ...
    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!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. who set my all my products date available at 1970-01-01?
    By andy2012 in forum General Questions
    Replies: 1
    Last Post: 18 Aug 2012, 10:41 AM
  2. v139h Question about Products Date Available vs Sold Out
    By I wish I could in forum Installing on a Linux/Unix Server
    Replies: 0
    Last Post: 9 Aug 2012, 05:27 AM
  3. Problem with Date Available products
    By kyotox in forum Setting Up Categories, Products, Attributes
    Replies: 5
    Last Post: 9 Aug 2009, 11:39 PM
  4. Products Expected/Date Available
    By janellez in forum Setting Up Categories, Products, Attributes
    Replies: 0
    Last Post: 26 Oct 2007, 05:38 AM
  5. New Products and Date Available
    By Darkwander in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 25 Feb 2007, 01:56 PM

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