Only prevent Product add-ons from adjusting prices if prices are honoured #510
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Part of https://github.com/woocommerce/woocommerce-subscriptions/issues/4535
Description
When using the Product Add-ons plugin and you pay for a subscription renewal, failed initial order or resubscribe, we were telling Product Add-ons to not adjust the price.
This caused issues when paying for initial parent orders because we (subscriptions) don't automatically grandfather the price and so we need Product Add-ons to actually calculate the add-on prices in that case.
This PR fixes that by making sure we only tell Product Add-ons to not adjust prices if we're going to honour the order/subscription total. To help explain, this little table explains what the cart product price source should be for the various scenarios:
* you can lock the parent order price by editing the order and hitting this checkbox
How to test this PR
trunk
you'll notice 2 things.trunk
the price is correct (the increased price).This doubling up of the add-ons will need to be fixed in the Product Add-ons plugin. I've got some working changes that I'll submit to their repo.
Product impact