K
K
Konstantin Rudenko2017-05-05 00:52:03
WordPress
Konstantin Rudenko, 2017-05-05 00:52:03

How to add product size filter in WooCommerce?

Probably the whole Internet has already climbed, everywhere the same filter plugins are offered, but they can only filter by custom attributes that are added to the product separately, but the products have their own, basic, attributes - dimensions (width, height, depth).
How to filter products by these dimensions?
Thanks in advance.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
W
WordPress WooCommerce, 2017-05-05
@assistent0

The data is in a metafield with the key _height.
With a strong desire, you can write your own filter for this metafield. WP_Query makes this possible.
On a small amount of the database will work approx.
On a large database, you need to do it through Algolia or ElasticSearch.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question