I
I
ItsCoder2018-05-30 18:43:41
WordPress
ItsCoder, 2018-05-30 18:43:41

How to group product options in WooCommerce cart?

There is a variant WooCommerce product with different sizes. Added two sizes to cart.
5b0ec560abb37330108000.jpeg
Now: The cart displays two items, with different sizes.
Required: display one product with dimensions.
Searched the Internet, found nothing. Can anyone come across this, found ready-made solutions?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Sharlaev, 2018-05-31
@entity1313

I don’t know about ready-made solutions, but in general the task requires changing the cart code.
By default, these are two different products, one after the other in the output loop. Accordingly, it is required to go through all the positions in the loop before displaying the basket, perform the necessary manipulations with the data, and display everything in a modified form.
As part of the plugin, you can intercept the cart template - it will be more environmentally friendly, you won't have to change the theme code. Otherwise, you (if I'm not mistaken) got a good answer to the stackexchange - there may be problems with the price, etc. That is, there are problems that are better thought out right away.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question