问题
I am implementing dependent product variations in woocommerce. The problem is that the product has to sizes it is available in Large and Small. The Large size has colors available but the small size of product has a transparent look.
I have added two attributes to the product Size and Color. Now what i want to happen is that when the user selects Large size colors should show up but if he chooses small size the color options select should go blank.
Is there any other way then using a no color options in colors select for Small size?
回答1:
Basically you just need to remove the "small" variations with color.
- Make sure your color options are ordered after your size options in the attributes section of the product. Make sure you save.
- In your color options group create a transparent color.
- Remove all variations that include Small and a color except for small and transparent
- If a user chooses small, then they will only have an option for transparent
I just did the exact same thing on a site.
来源:https://stackoverflow.com/questions/17630229/dependent-product-variations-in-woocommerce