How to add custom custom product filter in vue-storefront

喜你入骨 提交于 2021-01-29 07:28:54

问题


I have a question: how to implement additional filter to the vue-storefront product items filters?

There are 4 filters (colors, Erin Recommends, price, size) in the default category sidebar and I want to add my custom filter, for example "brand", but I have no idea how to do this. There are nothing useful I could find in the internet, this is official documentation, but this is not enough.

Can someone provide the manual or some documentation?

Thanks.


回答1:


  1. Make sure you have new attribute in your product inside Elasticsearcj - e.g. brand.
  2. Inside your config/local.json in products.defaultFilters add "brand".

Then after rerun app, you should see new filter on your category's view. Labels for this filter should be automatically fetched thanks to core/pages/Category.js -> asyncData and attribute/list action.



来源:https://stackoverflow.com/questions/64032634/how-to-add-custom-custom-product-filter-in-vue-storefront

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!