Are they all in the same category?
If so, you could set the best sellers to not select products where the master_categories_id is that category ...
Are they all in the same category?
If so, you could set the best sellers to not select products where the master_categories_id is that category ...
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!
Hi, yes they are all in a category of their own! So I assume I'd make a change very like whats detailed above? PLease could you spoonfeed me the code? Sorry to ask all this of you but I'm a moron at programming stuff!![]()
Let's say you want to toss out all products in categories_id 42 ...
That would now use the master_categories_id 42 in the products table so you should be able to use:
Note: this assumes all products that should not display use the same Category and that Category is "owns" these Products which would reflect that in that the master_categories_id of all of these Products would be the same ...PHP Code:$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.master_categories_id != 42
order by p.products_ordered desc, pd.products_name
limit " . MAX_DISPLAY_BESTSELLERS;
In this example:
this is the key to the block ...PHP Code:and p.master_categories_id != 42
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!
THANK YOU SO MUCH!!!! That's exactly what i needed!
Glad that this code worked for you ... thanks for the update!![]()
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!
Is there a way to exclude certain product categories from the 'All Products' list?
I noticed this on this thread:
and p.master_categories_id != 42
which would work perfectly if I could figure out how to apply it to all products instead of best sellers...
Thanks for the help!!! :)
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!
Hiya, i was wondering if it is possible to exclude certain products for the bestsellers list? there is 10 of them and they are in different catagories. They where givin as freebies for 3 days before going up for sale and so there for they have taken up all the space on the bestsellers box
Let's say you didn't want products_id 199 and 26 to show in the Best sellers sidebox ...
You could customize the best_sellers.php sidebox module with something like:
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 (199, 26)" . " 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 (199, 26)" . " order by p.products_ordered desc, pd.products_name limit " . MAX_DISPLAY_BESTSELLERS; $best_sellers = $db->Execute($best_sellers_query); }
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!
Thank you so much for the reply, i will give it a go and post back with a result xoxo