Automattic / woocommerce-subscriptions-core

Subscriptions core package for WooCommerce
Other
81 stars 29 forks source link

Ensure variable subscription products have the "Used for variations" checkbox enabled on WC v7.9.0 #476

Closed james-allan closed 11 months ago

james-allan commented 11 months ago

Fixes #476

Description

In WC 7.9 (released today) they introduced a new concept for HTML elements on the edit product page to be enabled and disabled based on the product type. eg enable_if_variable. This builds on the existing show_if_variable.

However, WC core would only enable these fields based on the product type. This meant that the enable_if_variable elements, which variable subscription products are supposed to inherit, were being left disabled.

This PR fixes that by making sure we enable these fields after WC enables/disables them.

How to test this PR

  1. Make sure you're running WC 7.9
  2. Create a variable subscription product.
  3. Go to the attributes tab
    • on trunk you'll notice the "Used for variations" checkbox is disabled.
    • on this branch it should be enabled and can be checked/unchecked.

Product impact