B
B
bohansky2021-02-05 21:51:09
WordPress
bohansky, 2021-02-05 21:51:09

How to sort variable products by variation with a certain attribute?

There are bulk goods. Designed in the form of variable goods with different weights. For example, one product can be purchased for 100, 50 and 10 grams, the other for 500, 100 grams. How to sort products by price so that they are sorted by product variation per 100 grams for all products? It is necessary that the weight attribute be taken, and if it is 100 grams, then sort the goods by the price of this variation.

The standard sorting by price considers each variation separately and it happens that a product has a minimum weight of only 100 grams and it will be much higher than the one with a weight of 10 grams.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
no_one_safe, 2021-02-05
@no_one_safe

When requesting, you need to make a calculated field - price\grams. Get the price for 1 gram. And sort by this field.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question