Hi,
is it possible to prevent a specific category, and its products from displaying in the "new products" box?
If yes how can it be done?
On a side note would it be advisable as per SEO?
Thank you
Hi,
is it possible to prevent a specific category, and its products from displaying in the "new products" box?
If yes how can it be done?
On a side note would it be advisable as per SEO?
Thank you
You could block them based on the master_categories_id by using your templates and overrides and customizing:
/includes/modules/new_products.php
to the file:
/includes/modules/your_templates_directory/new_products.php
And add to the 2 SELECT statements something like, for example to block categories_id 10, us:
Code:and p.master_categories_id != 10
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!
Thank you.
If you don't mind I would need a little (lot) more info, not being a coder.
I put the snip you suggested like this
But it does display the product inserted in that category (id 66), both in the new products box, and in the new products listing page.Code:select distinct p.products_id, p.products_image, p.products_tax_class_id, pd.products_name, pd.products_description, p.products_date_added, p.products_price, p.products_type, p.master_categories_id and p.master_categories_id != 66
Will you kindly tell me how exactly I should add your code?
In the first SELECT, to block master_categories_id 10 try using:
Then do the same in the other SELECT statement in that file ...Code:$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 p.master_categories_id != 10 and pd.language_id = '" . (int)$_SESSION['languages_id'] . "' and p.products_status = 1 " . $display_limit;
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!
Thank you again.
I copy-pasted the code you posted, but it still displays the new product.
A bit confused on the != 10 is that the category's id number, or it has to be 10?
I tried both, 10 as per your code, and 66 as the category id of the store.
Last edited by keneso; 26 May 2012 at 07:16 PM. Reason: misspelling
If your Category is categories_id 66 and your Products use that as their master_categories_id then you want to use:
Code:and p.master_categories_id != 66
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!
Thank you for your patience.
I added
and p.master_categories_id != 66
to
modules/pages/products_new/header_php.php
as well, and it works fine.
Thanks for the update that this is now working for you ...
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!
I need an update of the code please.
I added sub-cats to the category with id 66, and noticed they do display, then I added
to /includes/modules/your_templates_directory/new_products.phpCode:and p.master_categories_id != 66 and p.master_categories_id != 67 and p.master_categories_id != 68
and it works fine.
Question:
is that correct way of doing, or there is a group syntax I'm unaware of, i.e.
Actually I tried that, and other "creative" combinations, but of course knowing nothing they returned errors.Code:and p.master_categories_id != '66 67 68'?
Thank you
You need to be using the master_categories_id of the Products that you do not want to display ...
So if they are in a Category with categories_id 66 then a subcategory where the categories_id is 68, the the master_categories_id is most likely 68 ...
If you are unsure of the master_categories_id ... edit the Product and you will see:
Product Master Category:
and that will list the master_categories_id
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!
Bookmarks