Results 1 to 8 of 8
  1. #1
    Join Date
    Feb 2009
    Posts
    3
    Plugin Contributions
    0

    Default Remove featured product from new product list

    Hi,

    When I setup featured prod. they show in featured list and new prod. list,
    How can I remove featured product from new product list?

    Maybe someone could modificate sql query in:
    /includes/modules/new_products.php

    to check if in database at featured table, status is 1. If status = 1 dont show product in new product list.

    Thank you.

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

    Default Re: Remove featured product from new product list

    New Products are based on the setting for the Configuration ... Maximum Values ...
    New Product Listing - Limited to ...
    Limit the New Product Listing to
    0= All Products
    1= Current Month
    7= 7 Days
    14= 14 Days
    30= 30 Days
    60= 60 Days
    90= 90 Days
    120= 120 Days
    That is then determined by the products_date_added in the products table ...

    If you do not want something that was added and would normally fall within your setting for the New Products, you could change the date in the products_date_added in the products table to be older so it won't show there ...
    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!

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

    Default Re: Remove featured product from new product list

    But every time, when I add product to featured list, I must edit database.
    Maybe someone know other way?.

  4. #4
    Join Date
    Jul 2006
    Location
    Montreal, Canada
    Posts
    2,279
    Plugin Contributions
    0

    Default Re: Remove featured product from new product list

    Quote Originally Posted by bamsik View Post
    But every time, when I add product to featured list, I must edit database.
    Maybe someone know other way?.
    I think Ajeh with over 45000 post knows thing or two

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

    Default Re: Remove featured product from new product list

    You could try this and see if it works with your version of MySQL ...

    Code:
    $display_limit = zen_get_new_date_range();
    
    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 . "
                               and p.products_id not in (select products_id from " . TABLE_FEATURED . ")";
    } else {
      // get all products and cPaths in this subcat tree
      $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);
    
      if (is_array($productsInCategory) && sizeof($productsInCategory) > 0) {
        $sql = "select products_id from " . TABLE_FEATURED . " where status = 1";
        $result = $db->Execute($sql);
        while (!$result->EOF) {
          if (isset($productsInCategory[$result->fields['products_id']])) {
            unset($productsInCategory[$result->fields['products_id']]);
          }
          $result->MoveNext();
        }
    
        // build products-list string to insert into SQL query
        foreach($productsInCategory as $key => $value) {
          $list_of_products .= $key . ', ';
        }
        $list_of_products = substr($list_of_products, 0, -2); // remove trailing comma
    
        $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_id in (" . $list_of_products . ")";
      }
    }
    
    if ($new_products_query != '') $new_products = $db->ExecuteRandomMulti($new_products_query, MAX_DISPLAY_NEW_PRODUCTS);
    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
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Remove featured product from new product list

    oops! Little goober there for when all products are Featured ...

    Move the code:
    Code:
        $sql = "select products_id from " . TABLE_FEATURED . " where status = 1";
        $result = $db->Execute($sql);
        while (!$result->EOF) {
          if (isset($productsInCategory[$result->fields['products_id']])) {
            unset($productsInCategory[$result->fields['products_id']]);
          }
          $result->MoveNext();
        }
    above the line:
    Code:
      if (is_array($productsInCategory) && sizeof($productsInCategory) > 0) {
    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!

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

    Default Re: Remove featured product from new product list

    Perfect Thank you very much

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

    Default Re: Remove featured product from new product list

    Be sure to really test this with all aspects of your cart to ensure nothing was missed ...

    Thank DrByte for his help on this one ... I just tidied it up a bit more ...
    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!

 

 

Similar Threads

  1. New Product list is different from regular product list
    By elite supplement in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 17 Sep 2012, 12:43 AM
  2. Remove random from Featured Product sidebox
    By volante in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 18 Sep 2011, 05:49 AM
  3. Remove Product xx/xx from top of product list
    By wolfsz in forum Customization from the Admin
    Replies: 3
    Last Post: 22 Jan 2010, 02:50 PM
  4. Deleting Product Didn't Remove From Featured Products?
    By msmith29063 in forum General Questions
    Replies: 2
    Last Post: 24 Dec 2008, 07:49 AM
  5. Remove buy buttons from featured product column
    By bjmhistory in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 18 Feb 2007, 10:12 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