Page 2 of 4 FirstFirst 1234 LastLast
Results 11 to 20 of 32
  1. #11
    Join Date
    May 2016
    Location
    Ohio
    Posts
    410
    Plugin Contributions
    0

    Default Re: Excluding Category from Bestsellers Sidebox

    The only folder with all those files are either template_default under includes/templates or responsive_classic
    The site says the template is set to meow, but in the meow folder, is a template_info.php file and in that it says:
    $template_name = 'Classic Contemporary Green';

  2. #12
    Join Date
    Nov 2005
    Location
    los angeles
    Posts
    2,684
    Plugin Contributions
    9

    Default Re: Excluding Category from Bestsellers Sidebox

    Quote Originally Posted by jmberman View Post
    The only folder with all those files are either template_default under includes/templates or responsive_classic
    The site says the template is set to meow, but in the meow folder, is a template_info.php file and in that it says:
    $template_name = 'Classic Contemporary Green';
    the 3 posts prior to your post have all of the information you need. i would advise re-reading them carefully. this is what i would do:

    • restore the template bestseller sidebox to its original format.
    • copy the includes/modules/sideboxes/best_sellers.php to includes/modules/sideboxes/YOUR_TEMPATE/best_sellers.php
    • modify the code in the new copied file to change the $bestsellers_list array to what you want.


    best.
    author of square Webpay.
    mxWorks has premium plugins. donations: venmo or paypal accepted.
    premium consistent excellent support. available for hire.

  3. #13
    Join Date
    May 2016
    Location
    Ohio
    Posts
    410
    Plugin Contributions
    0

    Default Re: Excluding Category from Bestsellers Sidebox

    Got it working, thank you all.

  4. #14
    Join Date
    May 2016
    Location
    Ohio
    Posts
    410
    Plugin Contributions
    0

    Default Re: Excluding Category from Bestsellers Sidebox

    updated question...

    What if I want to exclude more than one category?

    I thought this would work but doesn't:

    AND p.products_id NOT IN (SELECT products_id FROM " . TABLE_PRODUCTS_TO_CATEGORIES . " WHERE categories_id = 34, 55, 58)

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

    Default Re: Excluding Category from Bestsellers Sidebox

    SQL syntax is incorrect.

    = x, y, z doesn't "make sense"...
    What you are wanting is to get all rows that would be returned if the categories_id was in a group of numbers...
    That portion would be as this:

    categories_id IN (34, 55, 58)
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  6. #16
    Join Date
    May 2016
    Location
    Ohio
    Posts
    410
    Plugin Contributions
    0

    Default Re: Excluding Category from Bestsellers Sidebox

    So how would I change this current code?

    if (isset($current_category_id) && ($current_category_id > 0)) {
    $best_sellers_query = "select distinct p.products_id, pd.products_name, p.products_ordered
    from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, "
    . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c
    where (p.products_status = '1'
    and p.products_ordered > 0
    and p.products_id = pd.products_id
    and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'
    and p.products_id = p2c.products_id
    and p2c.categories_id = c.categories_id
    and '" . (int)$current_category_id . "' in (c.categories_id, c.parent_id))
    AND p.products_id NOT IN (SELECT products_id FROM " . TABLE_PRODUCTS_TO_CATEGORIES . " WHERE categories_id = 34)




    to include more categories?

  7. #17
    Join Date
    Apr 2006
    Location
    Ohio
    Posts
    6,162
    Plugin Contributions
    0

    Default Re: Excluding Category from Bestsellers Sidebox

    Try this:

    Code:
    if (isset($current_category_id) && ($current_category_id > 0)) {
    $best_sellers_query = "select distinct p.products_id, pd.products_name, p.products_ordered
    from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, "
    . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c
    where (p.products_status = '1'
    and p.products_ordered > 0
    and p.products_id = pd.products_id
    and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'
    and p.products_id = p2c.products_id
    and p2c.categories_id = c.categories_id
    and '" . (int)$current_category_id . "' in (c.categories_id, c.parent_id))
    AND p.products_id NOT IN (SELECT products_id FROM " . TABLE_PRODUCTS_TO_CATEGORIES . " WHERE categories_id IN (34, 55, 58))
    Mark
    Hare Do

  8. #18
    Join Date
    May 2016
    Location
    Ohio
    Posts
    410
    Plugin Contributions
    0

    Default Re: Excluding Category from Bestsellers Sidebox

    Okay so this actually deleted my bestseller sidebox?


    if (isset($current_category_id) && ($current_category_id > 0)) {
    $best_sellers_query = "select distinct p.products_id, pd.products_name, p.products_ordered
    from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, "
    TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c
    where (p.products_status = '1'
    and p.products_ordered > 0
    and p.products_id = pd.products_id
    and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'
    and p.products_id = p2c.products_id
    and p2c.categories_id = c.categories_id
    and '" . (int)$current_category_id . "' in (c.categories_id, c.parent_id))
    AND p.products_id NOT IN (SELECT products_id FROM " . TABLE_PRODUCTS_TO_CATEGORIES . " WHERE categories_id IN (34, 55, 58))
    order by p.products_ordered desc, pd.products_name
    limit " . MAX_DISPLAY_BESTSELLERS;

    $best_sellers = $db->Execute($best_sellers_query);

    } else {
    $best_sellers_query = "select distinct p.products_id, pd.products_name, p.products_ordered
    from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd
    where (p.products_status = '1'
    and p.products_ordered > 0
    and p.products_id = pd.products_id
    and pd.language_id = '" . (int)$_SESSION['languages_id'] . "')
    AND p.products_id NOT IN (SELECT products_id FROM " . TABLE_PRODUCTS_TO_CATEGORIES . " WHERE categories_id IN (34, 55, 58))

  9. #19
    Join Date
    Apr 2006
    Location
    Ohio
    Posts
    6,162
    Plugin Contributions
    0

    Default Re: Excluding Category from Bestsellers Sidebox

    take out the extra ) here.
    Find: 58))
    Change to 58)
    Mark
    Hare Do

  10. #20
    Join Date
    May 2016
    Location
    Ohio
    Posts
    410
    Plugin Contributions
    0

    Default Re: Excluding Category from Bestsellers Sidebox

    Best Seller, Specials, Online boxes all vanish with this:

    if (isset($current_category_id) && ($current_category_id > 0)) {
    $best_sellers_query = "select distinct p.products_id, pd.products_name, p.products_ordered
    from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, "
    TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c
    where (p.products_status = '1'
    and p.products_ordered > 0
    and p.products_id = pd.products_id
    and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'
    and p.products_id = p2c.products_id
    and p2c.categories_id = c.categories_id
    and '" . (int)$current_category_id . "' in (c.categories_id, c.parent_id))
    AND p.products_id NOT IN (SELECT products_id FROM " . TABLE_PRODUCTS_TO_CATEGORIES . " WHERE categories_id IN (34, 55, 58)
    order by p.products_ordered desc, pd.products_name
    limit " . MAX_DISPLAY_BESTSELLERS;

    $best_sellers = $db->Execute($best_sellers_query);

    } else {
    $best_sellers_query = "select distinct p.products_id, pd.products_name, p.products_ordered
    from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd
    where (p.products_status = '1'
    and p.products_ordered > 0
    and p.products_id = pd.products_id
    and pd.language_id = '" . (int)$_SESSION['languages_id'] . "')
    AND p.products_id NOT IN (SELECT products_id FROM " . TABLE_PRODUCTS_TO_CATEGORIES . " WHERE categories_id IN (34, 55, 58)

    order by p.products_ordered desc, pd.products_name
    limit " . MAX_DISPLAY_BESTSELLERS;

    $best_sellers = $db->Execute($best_sellers_query);
    }

 

 
Page 2 of 4 FirstFirst 1234 LastLast

Similar Threads

  1. v151 Excluding currencies from sidebox
    By pititis in forum General Questions
    Replies: 0
    Last Post: 13 Jun 2013, 10:55 AM
  2. Excluding category from search
    By kgeoffrey in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 13 Jan 2009, 12:46 AM
  3. Excluding an item from bestsellers sidebox
    By Heather88 in forum Basic Configuration
    Replies: 4
    Last Post: 23 May 2007, 08:56 PM
  4. Excluding a category from the Categories sidebox
    By Heather88 in forum Basic Configuration
    Replies: 5
    Last Post: 23 Apr 2007, 09:48 PM
  5. Excluding 1 Category from New Products
    By libracorn in forum Setting Up Categories, Products, Attributes
    Replies: 19
    Last Post: 1 Oct 2006, 10:43 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