Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delete variations when product type changes to a non-variable product #26959

Closed
gumgumcode opened this issue Jul 6, 2020 · 0 comments · Fixed by #27137
Closed

Delete variations when product type changes to a non-variable product #26959

gumgumcode opened this issue Jul 6, 2020 · 0 comments · Fixed by #27137
Labels
priority: normal The issue/PR is of normal priority—not many people are affected or there’s a workaround, etc. type: enhancement The issue is a request for an enhancement.

Comments

@gumgumcode
Copy link
Contributor

Is your feature request related to a problem? Please describe.

The issue isn't exactly with WC Core but fixing it here makes more sense as it simply supports what needs to happen in WC Subscriptions by making a minor change in product_type_changed function without any side-effects in WC Core.

Current function
Proposed changes to the function

The original issue is located in WC Subscriptions: https://github.com/woocommerce/woocommerce-subscriptions/issues/3672 and a potential PR for it is located here: https://github.com/woocommerce/woocommerce-subscriptions/pull/3732.

Describe the solution you'd like

The PR I linked above achieves the following expected behavior:

  • Changing product type from variable subscription to variable product (and vice versa) will preserve the variations (will not delete them).
  • Changing the product type from variable sub/product to a non-variable product will delete the variations.

If this sounds good, I'll make a new PR in WC Core (moving the code from my PR in WC Subscriptions).

Describe alternatives you've considered

Unhooking the product_type_changed function in WC Core and re-hooking it in WC Subscriptions as explained in the PR linked above but it makes more sense to do it WC Core.

@gumgumcode gumgumcode added type: enhancement The issue is a request for an enhancement. needs: author feedback The issue/PR needs a response from any of the parties involved in the issue. priority: normal The issue/PR is of normal priority—not many people are affected or there’s a workaround, etc. labels Jul 6, 2020
@juliaamosova juliaamosova removed the needs: author feedback The issue/PR needs a response from any of the parties involved in the issue. label Jul 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: normal The issue/PR is of normal priority—not many people are affected or there’s a workaround, etc. type: enhancement The issue is a request for an enhancement.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants