I am working on a WooCommerce website where I have a variable product, and the client wants a custom functionality for how variations are selected and added to the cart. By default, WooCommerce handles variations directly on the product page, allowing customers to choose their desired variation (e.g., size, color) and quantity before adding it to the cart.
However, my client wants the following workflow:
Step 1: The customer first selects the overall quantity of the product (e.g., 10 units).
Step 2: After the product is added to the cart, the customer is prompted to select the quantities for each variation (e.g., 3 units of variation A, 7 units of variation B).
The sum of the variation quantities should always equal the original quantity of course (in this case, 10).
Has anyone tackled a similar issue or have insights into how to best approach this customization?
Any suggestions, code examples, or existing plugins would be greatly appreciated!