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] Replace product/variation local filtering with WC 9.6+ API support with page size 25 #14843

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

Conversation

jaclync
Copy link
Contributor

@jaclync jaclync commented Jan 10, 2025

Closes: #1483

Description

This pull request updates products and variations and filtering criteria based on the latest decision pdfdoF-62l-p2#comment-7224. It removes the virtual local filter (as we want to show virtual products), replaces the downloadable local filter with a parameter in the API request that works for WC versions 9.6+, and updates the page size from 100 to 25 for products and variations requests.

Regarding the page size, I tested with the smallest font size on the tallest iOS device available - iPad Pro 13 in' so far in iOS 18.2. The minimum amount of items to fill the scroll view in portrait is 10. Even so, I picked 25 to match Android. Please feel free to share any thoughts on the page size.

🗒️ It's likely we will update the minimum WC version requirement to 9.6 for POS based on p1736485809856869/1736484154.214279-slack-C070SJRA8DP. Since 9.6 is still in beta 2 at the time of writing, we will postpone the version requirement bump until the version is publicly released.

Pagination and Product Parameters:

Test Updates:

Filtering Criteria:

Steps to reproduce

  • Switch to a store eligible for POS, has at least one variable and downloadable product, and has WC version >= 9.6
  • Go to Menu > Point of Sale mode --> the downloadable product should not be included, and all simple products in the list should have a price
  • Tap on a variable product --> variations should be loaded shortly, up to 25 per page

Testing information

  • @jaclync tests that the products are loaded without the downloadable filter for stores on WC version < 9.6

Screenshots

Notice that the downloadable products are filtered out.

before (with local filters removed) after
Simulator Screenshot - iPad Pro 11-inch (M4) - 2025-01-10 at 12 50 46 Simulator Screenshot - iPad Pro 11-inch (M4) - 2025-01-10 at 13 50 15

  • 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.

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

wpmobilebot commented Jan 10, 2025

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 Numberpr14843-42be4bc
Version21.3
Bundle IDcom.automattic.alpha.woocommerce
Commit42be4bc
App Center BuildWooCommerce - Prototype Builds #12463
Automatticians: You can use our internal self-serve MC tool to give yourself access to App Center if needed.

… to include virtual product in the API response.
@jaclync jaclync marked this pull request as ready for review January 10, 2025 07:08
@jaclync jaclync requested review from staskus, iamgabrielma and joshheald and removed request for iamgabrielma January 10, 2025 07:08
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.

This works as described. However, I think based on pdfdoF-62l-p2#comment-7285 it could be also expanded or done in another PR:

  • Allow no-price products
  • Restrict POS entry from 9.6+

func isNotDownloadable(product: Product) -> Bool {
!product.downloadable
}

func hasPrice(product: Product) -> Bool {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Based on pdfdoF-62l-p2#comment-7285, this one can be removed as well 👍

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