最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

wp query - How to get all product attributes for filters in WooCommerce?

programmeradmin1浏览0评论

I am trying to figure out how WooCommerce decides which product attribute filters to bring. Because it does not only bring filterable attributes of the products in first page of an archive, but also brings attributes of other products on next pages to be used as filters.

I tested this by adding an attribute to one of the sample products that does not appear on the first page of the archive. And it works. WooCommerce somehow knows about the filterable product attributes of products that are not in the query result of an archive page.

Does anybody know how? How can we query product attributes of all of the products of an archive page (like product category or search result page) to be used for filters? I assume it does not query all of the products in an archive of lets say 200 products, because that would be extremely costly in terms of database usage.

发布评论

评论列表(0)

  1. 暂无评论