M
M
Maxim Demidov2019-10-01 09:53:23
WordPress
Maxim Demidov, 2019-10-01 09:53:23

How to change the image of a variable product in the catalog when filtering?

Dear colleagues! Please let me know if anyone has faced similar issue. The bottom line is that there are variable products with their own attributes (size, color, material, etc.), there is a filter on the catalog page (by size, price, color). If you filter products by the desired color, it will show a selection of products that have variations with the color we need... But! In the selection, the image of the product is displayed the same - the one that is put in the capital when creating a variable product (regardless of which color is selected in the filter). Is it possible to somehow change the title image of a variable product to the image of a variation of the desired color when filtering on the catalog page? I can't even figure out which way to dig...

Answer the question

In order to leave comments, you need to log in

2 answer(s)
G
gian_tiaga, 2019-10-01
@gian_tiaga

Too little data.
how product variants, attributes are stored. This is a separate product in the database or implemented through links to the attribute table. What does the picture link to? When you answer these questions, the question will be solved by itself.

P
Pychev Anatoly, 2019-10-01
@pton

Like an idea. Didn't check.
Catch the hook for displaying the product image on the archives page. Check filter options. If necessary, replace the image with the desired one.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question