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

[Woo POS] [Variable Products] Add WC 9.7+ downloadable parameter to variations request #14893

Open
wants to merge 2 commits into
base: trunk
Choose a base branch
from

Conversation

jaclync
Copy link
Contributor

@jaclync jaclync commented Jan 16, 2025

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 to ProductVariationsRemote and updates related tests in ProductVariationsRemoteTests. The most important changes include adding the downloadable parameter to the request methods and ensuring that the correct parameters are set in the tests.

Updates to ProductVariationsRemote class:

  • Added the downloadable parameter to the productVariationsRequest method and updated the method signature to include this new parameter.
  • Included the downloadable parameter in the request parameters dictionary.
  • Added a new constant for the downloadable parameter key in the ParameterKey extension.

Updates to tests:

  • Added a new test test_loadVariationsForPointOfSale_sets_correct_parameters to verify that the downloadable parameter is correctly set when loading variations for a point of sale.
  • Added a new test test_loadAllProductVariations_sets_correct_parameters to verify that the downloadable 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.

  • Go to Menu > Point of Sale
  • Tap on the variable product in the prerequisite --> after loading, the downloadable variation should be visible (since the local filter hasn't been implemented)

WC version 9.7+

  • In wp-admin, upload the zip from the nightly build woocommerce-trunk-nightly.zip
  • Go to Menu > Point of Sale
  • Tap on the variable product in the prerequisite --> after loading, the downloadable variation should not be visible

Testing information

I tested it with WC version 9.7.0-dev.

Screenshots


  • I have considered if this change warrants user-facing release notes and have added them to 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:

  • The PR is small and has a clear, single focus, or a valid explanation is provided in the description. If needed, please request to split it into smaller PRs.
  • Ensure Adequate Unit Test Coverage: The changes are reasonably covered by unit tests or an explanation is provided in the PR description.
  • Manual Testing: The author listed all the tests they ran, including smoke tests when needed (e.g., for refactorings). The reviewer confirmed that the PR works as expected on all devices (phone/tablet) and no regressions are added.487

@jaclync jaclync added type: task An internally driven task. feature: POS labels Jan 16, 2025
@jaclync jaclync added this to the 21.5 milestone Jan 16, 2025
@wpmobilebot
Copy link
Collaborator

WooCommerce iOS📲 You can test the changes from this Pull Request in WooCommerce iOS by scanning the QR code below to install the corresponding build.

App NameWooCommerce iOS WooCommerce iOS
Build Numberpr14893-3969b45
Version21.4
Bundle IDcom.automattic.alpha.woocommerce
Commit3969b45
App Center BuildWooCommerce - Prototype Builds #12557
Automatticians: You can use our internal self-serve MC tool to give yourself access to App Center if needed.

@jaclync jaclync changed the title Feat/14871 filter downloadable variations wc 8.7 param [Woo POS] [Variable Products] Add WC 9.7+ downloadable parameter to variations request Jan 16, 2025
@jaclync jaclync marked this pull request as ready for review January 16, 2025 08:24
@jaclync jaclync requested review from joshheald and staskus January 16, 2025 08:24
Copy link
Collaborator

@staskus staskus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, works well.

Downloadable variations are no longer visible on 9.7.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature: POS type: task An internally driven task.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants