Hello,
It is the default functionality of WooCommerce. Please check how it works with the default wordpress theme.
Here’s a simplified explanation of how to set up product variations with size and color options in WooCommerce:
In your WordPress admin panel, go to “Products” and select “Attributes.”
Create the attribute “Size” and add the size options (S, M, L).
Create the attribute “Color” and add the color options (Red, Blue, Green).
Edit the product where you want to add variations.
Set the product type to “Variable product.”
Go to the “Attributes” tab and add both the “Size” and “Color” attributes.
Enter the size options (S, M, L) in the “Values” field of the Size attribute, and the color options (Red, Blue, Green) in the “Values” field of the Color attribute.
Make sure to tick the “Used for variations” box for each attribute.
Save the changes and go to the “Variations” tab.
Click “Add Variation” and choose the option to create variations from all attributes.
WooCommerce will generate all possible combinations of size and color variations.
Best Regards.