Hide products from a category in search results only
I've got a category which is available and visible and has active products in it but I don't want those products to show in general searches. The categoryid is 273.
In includes/search.php I tried adding the line: PHP Code:
Just below PHP Code:
It does add this to the query so it reads "...INNER JOIN xcart_categories ON xcart_products_categories.categoryid = xcart_categories.categoryid AND xcart_categories.avail = 'Y' AND xcart_categories.catgeoryid != 273 ... " but seems to have no effect. Any ideas how this can be done? |
Re: Hide products from a category in search results only
You have to add the condition in
where[] = ..... No need to "join" the table as it is already joined. |
Re: Hide products from a category in search results only
Thanks cflsystems but I realised this would only work if the main category of the product to be hidden was 273.
A better way I found (for anyone else who finds this thread) is to flush out the products after the database query has been completed. Like this: PHP Code:
|
All times are GMT -8. The time now is 08:35 AM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.