| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
Hide products from a category in search results only | |||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
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?
__________________
Verion 4.7.12 |
|||||||
#2
|
|||||||||
|
|||||||||
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.
__________________
Steve Stoyanov CFLSystems.com Web Development |
|||||||||
#3
|
|||||||
|
|||||||
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:
__________________
Verion 4.7.12 |
|||||||
|
|||
X-Cart forums © 2001-2020
|