automatewoo-subscriptions
automatewoo-subscriptions copied to clipboard
Allow updating all variations for a variable product
Internal links:
- Slack thread: https://prospress.slack.com/archives/CBG6F358D/p1555978627149100
- Support ticket: https://secure.helpscout.net/conversation/833868181/30741/?folderId=2702452
Customer wants to create a pre-paid subscription workflow for variations.
The problem is, the Update Product action can only handle one variation at a time.
I think the ideal approach would be to allow the store manager to choose the Variable product to update instead of each variation.
That should be relatively easy to achieve by:
- updating
$allow_variable_productsto betrue: https://github.com/Prospress/automatewoo-subscriptions/blob/04ceea0f70ce2962bc6177ef751f91594dceb845/includes/actions/update-product.php#L23 - looping over all items to edit all that match, instead of just the first one found that matches, that means moving the edit logic inside this loop: https://github.com/Prospress/automatewoo-subscriptions/blob/04ceea0f70ce2962bc6177ef751f91594dceb845/includes/actions/update-product.php#L82-L97 (really, that should probably be being done already in case the subscription has products with the same ID, and different meta data from product add-ons or similar).