[Woo POS] [Variable Products] Add WC 9.7+ downloadable parameter to variations request #14893
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 #14871
Description
I decided to only PR the WC 9.7+ parameter addition without the local filter for easier testing. There will be a future PR for the local filter to filter out downloadable variations for < 9.7.
This pull request introduces a new
downloadable
parameter toProductVariationsRemote
and updates related tests inProductVariationsRemoteTests
. The most important changes include adding thedownloadable
parameter to the request methods and ensuring that the correct parameters are set in the tests.Updates to
ProductVariationsRemote
class:downloadable
parameter to theproductVariationsRequest
method and updated the method signature to include this new parameter.downloadable
parameter in the request parameters dictionary.downloadable
parameter key in theParameterKey
extension.Updates to tests:
test_loadVariationsForPointOfSale_sets_correct_parameters
to verify that thedownloadable
parameter is correctly set when loading variations for a point of sale.test_loadAllProductVariations_sets_correct_parameters
to verify that thedownloadable
parameter is not set when loading all product variations.Steps to reproduce
Prerequisite: the store has a variable product with a downloadable variation. This can only be set in wp-admin, not in the app. The WC plugin in the store can be managed manually.
WC version < 9.7
🗒️ As 9.6 is not publicly released yet, you can enable variable products by removing this line.
WC version 9.7+
Testing information
I tested it with WC version 9.7.0-dev.
Screenshots
RELEASE-NOTES.txt
if necessary.Reviewer (or Author, in the case of optional code reviews):
Please make sure these conditions are met before approving the PR, or request changes if the PR needs improvement: