automatewoo-subscriptions icon indicating copy to clipboard operation
automatewoo-subscriptions copied to clipboard

Allow updating all variations for a variable product

Open thenbrent opened this issue 6 years ago • 0 comments

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:

  1. updating $allow_variable_products to be true: https://github.com/Prospress/automatewoo-subscriptions/blob/04ceea0f70ce2962bc6177ef751f91594dceb845/includes/actions/update-product.php#L23
  2. 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).

thenbrent avatar Apr 23 '19 12:04 thenbrent