Results 1 to 7 of 7
  1. #1
    Join Date
    Jan 2009
    Posts
    45
    Plugin Contributions
    0

    Default Upcoming products in new_products

    Hello,
    Can you please advise how I can avoid the upcoming products to display in new products?

    TY

  2. #2
    Join Date
    Jan 2009
    Posts
    45
    Plugin Contributions
    0

    Default Re: Upcoming products in new_products

    Please help

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

    Default Re: Upcoming products in new_products

    Peek in the Configuration ... New Listing ...
    Mask Upcoming Products from being include as New Products
    Do you want to mask Upcoming Products from being included as New Products in Listing, Sideboxes and Centerbox?
    0= off
    1= on
    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: v1.5.5]
    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!

  4. #4
    Join Date
    Jan 2009
    Posts
    45
    Plugin Contributions
    0

    Default Re: Upcoming products in new_products

    I want mask Upcoming Products from New Products in Listing.

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

    Default Re: Upcoming products in new_products

    I would add a new function to build the limit to exclude upcoming products such as:
    Code:
    // build date range for upcoming products
      function zen_get_upcoming_date_range_exclude() {
        // 120 days; 24 hours; 60 mins; 60secs
        $date_range = time();
        $zc_new_date = date('Ymd', $date_range);
        $new_range = ' and p.products_date_available <=' . $zc_new_date . '235959';
    
        return $new_range;
      }
    You would need to customize the SQLs for the New Products and could use this:
    $upcoming_exclude_display_limit = zen_get_upcoming_date_range_exclude();

    and add the $upcoming_exclude_display_limit to the end of the SQL statements for the New Products ...

    The reason for the function is to build a component for the WHERE condition that will be fast ...

    For example, in the module for the new_products.php for the centerbox you can use:
    Code:
    $display_limit = zen_get_new_date_range();
    
    // build date range for upcoming products
      function zen_get_upcoming_date_range_exclude() {
        // 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';
    
        return $new_range;
      }
    
    $upcoming_exclude_display_limit = zen_get_upcoming_date_range_exclude();
    
    if ( (($manufacturers_id > 0 && $_GET['filter_id'] == 0) || $_GET['music_genre_id'] > 0 || $_GET['record_company_id'] > 0) || (!isset($new_products_category_id) || $new_products_category_id == '0') ) {
      $new_products_query = "select distinct p.products_id, p.products_image, p.products_tax_class_id, pd.products_name,
                                    p.products_date_added, p.products_price, p.products_type, p.master_categories_id
                               from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd
                               where p.products_id = pd.products_id
                               and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'
                               and   p.products_status = 1 " . $display_limit . $upcoming_exclude_display_limit;

    Then change the other part of the IF
    Code:
      $productsInCategory = zen_get_categories_products_list( (($manufacturers_id > 0 && $_GET['filter_id'] > 0) ? zen_get_generated_category_path_rev($_GET['filter_id']) : $cPath), false, true, 0, $display_limit . $upcoming_exclude_display_limit);
    NOTE: I would put the function in a file in the:
    /includes/functions/extra_functions

    so that you can use it for other things such as adapting it for the New Product Listing and sidebox ...

    I have not tested everything on this but it should work ...
    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: v1.5.5]
    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
    Jan 2009
    Posts
    45
    Plugin Contributions
    0

    Default Re: Upcoming products in new_products

    OK :) Im going to try it :) thank you

  7. #7
    Join Date
    Jan 2009
    Posts
    45
    Plugin Contributions
    0

    Default Re: Upcoming products in new_products

    Hello,
    help me again please I used your script in products_new ther works good :) but I want to use here tpl_modules_products_new_listing.php
    but I dont know how ... thank you

 

 

Similar Threads

  1. How to disable boxes 'New Products For', 'upcoming products' etc.'?
    By yalus in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 3 Feb 2011, 03:49 PM
  2. new_products.php - replacing $new_products->fields['products_name'] with manufacturer
    By limelites in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 15 Mar 2009, 10:18 PM
  3. Upcoming Products
    By audiografix in forum General Questions
    Replies: 1
    Last Post: 31 Oct 2008, 01:50 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