8manos / wc-variations-radio-buttons

Let your customers choose product variations using radio buttons instead of dropdowns.
https://wordpress.org/plugins/wc-variations-radio-buttons/
GNU General Public License v2.0
62 stars 34 forks source link

Disable variations even when there's only one attribute #2

Closed Sphinxxxx closed 8 years ago

Sphinxxxx commented 8 years ago

Recent versions of WooCommerce (since 2.3.0?) has a woocommerce_variation_is_active filter which lets you disable ("grey out") e.g. out-of-stock items from the variations dropdown: https://github.com/woothemes/woocommerce/issues/5661

Therefore, to disable the corresponding radiobuttons, the check_available_attributes event handler needs to check each variation's .variation_is_active property in all cases, not only when there are multiple attributes.

Mantish commented 8 years ago

cool, thanks!

Sphinxxxx commented 8 years ago

Hmm.. This triggered a bug that disables any variation value that's not a number or a lowercase string. I submitted a new pull request with a suggested fix.