Close

Category filter

haknesh
9 years ago
#8570 Quote
Avatar
  • 29
Hello,

I have two main categories in my shop: 'Ladies' and 'Gentlemen' .
The nop ajax filters works great on those categories and also in the manufacturers pages.
Now i would like to add one extra filter on the manufacturers details pages, to filter it's products by my main categories. So filter by gender. Only this extra filter should not appear on the category pages.
What is the best way to achieve this?

Thanks in advance!

Kind regards,
Haknesh.
iliyan.tanev
9 years ago
#8577 Quote
Avatar
  • 347
Hi,

You could add an Gender attribute to your products. This way you will get a Gender panel with the desired genders as options.
To hide it in certain categories you will need to make changes to Plugins\SevenSpikes.Nop.Plugins.AjaxFilters\Views\AttributeFilter7Spikes\AttributeFilter.cshtml. There you will find a foreach looping through the FilterItems. You will need to add the following code at the beginning of it and make the firstCategoryId and secondCategoryId to correspond to your category ids. 

if (Model.CategoryId == firstCategoryId || Model.CategoryId == secondCategoryId && attributeFilterGroup.Name == "Gender")
{
     continue;
}
Regards,
Iliyan Tanev
Nop-Templates Dev Team
haknesh
9 years ago
#8579 Quote
Avatar
  • 29
Hi Iliyan,

Thanks a lot, i will try your suggestion.

However, one more point, you said 'add an Gender attribute to your products' . Do i have to use product attributes for filters? i used for all my filters 'specification filters' . Is that wrong?
iliyan.tanev
9 years ago
#8580 Quote
Avatar
  • 347
No, the specification attributes are fine too.
Regards,
Iliyan Tanev
Nop-Templates Dev Team
haknesh
9 years ago
#8582 Quote
Avatar
  • 29
Thank you Iliyan! it's working now.
jakubz
9 years ago
#10179 Quote
Avatar
  • 182
Can i create specific filters for a category?

Example:
Monitors: > Filters: Resolution; Led/LCD, Ports; etc.
Processors > Filters: Vendor, Core, Socket.

Is this possible from admin Panel (we have 3.5 ver ... We are planning updating to 3.6)?
iliyan.tanev
9 years ago
#10180 Quote
Avatar
  • 347
Hi,

You can not assign filter options to categories. Actually, filter options depend on the specifications and attributes that you have assigned to the products from the category. So, if you have products that have only the Resolution, Led/LCD, Ports specifications in the Monitors Category, only they will be available as filter options.

Hope this helps!
Regards,
Iliyan Tanev
Nop-Templates Dev Team
toanhnt
9 years ago
#10271 Quote
Avatar
  • 35
Hi support team,

I don't want the filter to be shown on one category. 
In settings: Category Ids (split by comma):
There's no Id for category in Nopcommerce.
Please advise!

Thanks
iliyan.tanev
9 years ago
#10276 Quote
Avatar
  • 347
Hi,

In setting text box you should enter the id/s of the categories on which you don't want the filters to be shown, splitted by comma.

You can get the id of certain category from the database or from the administration -> Catalog -> Categories -> List -> Your category -> Edit. On the end of the url you will see a number. This is the category id that you must enter in the Category Ids (Splitted by comma) text box.

Hope this helps!
Regards,
Iliyan Tanev
Nop-Templates Dev Team