| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
How to Exclude Disabled Categories from a Search | ||||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
How to Exclude Disabled Categories from a Search
I have a category that is not "Enabled" (disabled). I have products in this category that I do not want to a appear in customer search. However they do appear during a search.
So...how can I exclude any products in a disabled category from a search? Any insight into this would be mucho appreciated! BTW - This is for a 4.0.12 Gold store.
__________________
X-Cart Gold 4.2.3 ----- PHP 5.2.17 | MySQL 5.1.52 |
|||||||
#2
|
|||||||
|
|||||||
Are the products themselves disabled or just the category?
__________________
Padraic Ryan Ryan Design Studio Professional E-Commerce Development |
|||||||
#3
|
|||||||
|
|||||||
Just the category.
__________________
X-Cart Gold 4.2.3 ----- PHP 5.2.17 | MySQL 5.1.52 |
|||||||
#4
|
|||||||
|
|||||||
Disable the products as well.
__________________
Padraic Ryan Ryan Design Studio Professional E-Commerce Development |
|||||||
#5
|
|||||||
|
|||||||
I can't they are used in another area.
Basically the items in this category are only upsell accessory products. They are listed at the bottom of certain 'product detail' pages (product.php) with simply a Buy Now button. There are no details for these items so I don't want them coming up in the search. If I disable the products themselves, the won't appear as upsell items as I have them now. HOw can exclude items from the serach function depending on category being disabled? Or if thet;s not possible...how can I exclude items based on their categiry ID? It's only one category, so I can hard code that one category into the query as an exclusion. Questions is where do I do this?
__________________
X-Cart Gold 4.2.3 ----- PHP 5.2.17 | MySQL 5.1.52 |
|||||||
#6
|
|||||||
|
|||||||
Hmmm...good question...and one I can't answer Shan? Boomer?
__________________
Padraic Ryan Ryan Design Studio Professional E-Commerce Development |
|||||||
#7
|
|||||||
|
|||||||
It think I've got this figured out. It appears to be working...at least for me it is.
If anyone else wants to exclude all products in disabled categories from appearing in the search results try this: This is in XC Gold 4.0.12. Locate the following code at around line 220 in include/search.php: Code:
And change to this: Code:
__________________
X-Cart Gold 4.2.3 ----- PHP 5.2.17 | MySQL 5.1.52 |
|||||||
#8
|
|||||||
|
|||||||
Hey Mustang...maybe you can help me out with something since you are damn close with this little bit of code to what I want
I'm using Jon's hidden categories mod for a client, which you can find here: http://forum.x-cart.com/viewtopic.php?t=11326 Works great, but the products in those hidden categories are showing up in the search results. I tried your code above, but that is also hiding the products from displaying in the hidden category. Any ideas? Thanks in advance!
__________________
Padraic Ryan Ryan Design Studio Professional E-Commerce Development |
|||||||
#9
|
|||||||||
|
|||||||||
if a category is set to disabled or hidden then products in that category should not show up anywhere and so this sounds like a bug.
If you can confirm that this is happening on a non modified cart then we should move this to bugs forum
__________________
Looking for a reliable X-cart host ? You wont go wrong with either of these. EWD Hosting Hands On Hosting |
|||||||||
#10
|
|||||||
|
|||||||
Just tested this out in a fresh install of X-Cart and the same thing is happening. Using Jon's hidden categories mod, the products in the hidden categories are showing up in the search results. Mustang's mod above fixes the search results problem, but also ends up hiding the products in the hidden category as well Ideas anyone?
__________________
Padraic Ryan Ryan Design Studio Professional E-Commerce Development |
|||||||
|
|||
X-Cart forums © 2001-2020
|