Results 1 to 10 of 34

Hybrid View

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

    Default Re: Excluding a product or category from best selling list

    The SELECT statement for All Products is in the:
    /includes/modules/pages/products_all/header_php.php

    You can customize it in there ...

    NOTE: this is not an override file so be sure to save both the original and your changes ...
    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!

  2. #2

    Default Re: Excluding a product or category from best selling list

    Thanks so much! That worked like a charm! :)

  3. #3
    Join Date
    Jun 2006
    Location
    My family and I live in Brighton, England
    Posts
    982
    Plugin Contributions
    0

    Default Re: Excluding a product or category from best selling list

    I would like to exclude my Sold Gallery category from displaying in Featured Products. in featured_products.php would I just add:
    PHP Code:
    and p.master_categories_id != 
    to get:
    PHP Code:
    if ( (($manufacturers_id && $_GET['filter_id'] == 0) || $_GET['music_genre_id'] > || $_GET['record_company_id'] > 0) || (!isset($new_products_category_id) || $new_products_category_id == '0') ) {

      
    $featured_products_query "select distinct p.products_id, p.products_image, pd.products_name, p.master_categories_id

                               from (" 
    TABLE_PRODUCTS " p

                               left join " 
    TABLE_FEATURED " f on p.products_id = f.products_id

                               left join " 
    TABLE_PRODUCTS_DESCRIPTION " pd on p.products_id = pd.products_id )

                               where p.products_id = f.products_id

                               and p.products_id = pd.products_id

                               and p.products_status = 1 and f.status = 1

                               and p.master_categories_id != 8
                               and pd.language_id = '" 
    . (int)$_SESSION['languages_id'] . "'"
    Thanks!

  4. #4
    Join Date
    Jun 2006
    Location
    My family and I live in Brighton, England
    Posts
    982
    Plugin Contributions
    0

    Default Re: Excluding a product or category from best selling list

    There was an easy fix to address my issue in this thread. I was able to stop all sold items from appearing in New Products.

  5. #5
    Join Date
    Jun 2006
    Location
    My family and I live in Brighton, England
    Posts
    982
    Plugin Contributions
    0

    Default Re: Excluding a product or category from best selling list

    Info from the previously mentioned thread allowed me to block items with a 0 product count. To block entire categories from displaying in New Products, see this thread.

  6. #6
    Join Date
    Feb 2007
    Posts
    10
    Plugin Contributions
    0

    Default Re: Excluding a product or category from best selling list

    I got a MySQL error when trying the above fix:
    Code:
    1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'p.product_is_free != 1 order by p.products_ordered ' at line 10
    in:
    [select distinct p.products_id, pd.products_name, p.products_ordered                              from products p, products_description pd, products_to_categories p2c, categories c                              where p.products_status = '1'                              and p.products_ordered > 0                              and p.products_id = pd.products_id                              and pd.language_id = '1'                              and p.products_id = p2c.products_id                              and p2c.categories_id = c.categories_id                              and '67' in (c.categories_id, c.parent_id) 				     p.product_is_free != 1                              order by p.products_ordered desc, pd.products_name                              limit 20]
    What did I do wrong?

 

 

Similar Threads

  1. Excluding free items from Best Sellers
    By meljen in forum Customization from the Admin
    Replies: 3
    Last Post: 29 Nov 2012, 03:57 AM
  2. Best selling list for a defines period - is it possible?
    By CaroleAs in forum Basic Configuration
    Replies: 9
    Last Post: 21 Nov 2010, 11:19 PM
  3. Excluding category from search
    By kgeoffrey in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 13 Jan 2009, 12:46 AM
  4. Excluding sideboxes from product list pages
    By ctcentralinfo in forum Templates, Stylesheets, Page Layout
    Replies: 9
    Last Post: 11 Jul 2008, 12:56 AM
  5. excluding categories from bestseller list
    By CreativeWitch in forum General Questions
    Replies: 0
    Last Post: 21 Feb 2007, 05:41 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