Answer the question
In order to leave comments, you need to log in
How to make the price on the product card dynamic when interacting with the filter?
Hello!
I'm not a programmer or a developer, but there was a need for one improvement on my site. I googled everywhere but couldn't find anything suitable.
My site is made on wordpress. Almost all goods are variable. Actually, we specialize in the sale of mattresses. Each mattress model has several sizes. Thus, the size of the mattress is an attribute that is used to form product variations. Each mattress size has its own price. Accordingly, the mattress size attribute is used in the filter. For this business, this is a key parameter.
Now to the heart of the matter. At this point I will post two screenshots.
On the category page, which has a filter, product cards are displayed. In the first screenshot, the filter has not yet been applied. The bottom line is that in the wokomers the price of variable goods is displayed as a range. My theme has a functionality that allows you to set a minimum price, which can be seen in the screenshots. The price in the screenshots is the minimum price of the product, that is, the price of the smallest mattress size.
If you start using the filter and set, for example, the maximum size, then... nothing changes. As you can see in the second screenshot. Accordingly, in order to see the real price of the size, you need to go to the product page and select the size. This is long, inconvenient, and makes the filter less useful.
The idea regarding the interaction of the filter and products is that when you select an attribute in the filter (in my case, the size of the mattress), to which its value is attached, the price on the product card changes. We chose the average size of the mattress - the minimum price on the product card has changed to the appropriate size. That is, to make the price dynamic.
Does anyone know how to implement this? Any plugin? Maybe someone has already solved this problem?
Here's another point. If it is possible to make the price dynamic, then it will probably be necessary to make it so that when several sizes are selected, the card is divided into how many separate ones, with the display of the price corresponding to the attribute. Is there any way to solve this? Can you advise something?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question