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] Bump minimum required WC version to 9.6, replace local products filters with downloadable parameter, page size 25 #14843

Merged
merged 15 commits into from
Jan 23, 2025

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-614a7a1
Version21.4
Bundle IDcom.automattic.alpha.woocommerce
Commit614a7a1
App Center BuildWooCommerce - Prototype Builds #12648
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
@joshheald joshheald mentioned this pull request Jan 10, 2025
4 tasks
Copy link
Contributor

@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
Contributor

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 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed in b192a0c.

@jaclync
Copy link
Contributor Author

jaclync commented Jan 13, 2025

Potential latest decision: p1736504688523299/1736484154.214279-slack-C070SJRA8DP

  • Empty-price and free products should be shown in POS
  • Virtual products should be shown in POS
  • Let's limit it to version 9.6+, but we need to ensure that it won't get released unless WooCommerce 9.6 is publicly available

Based on the proposed decision above, I will wait for WC 9.6 to be released this week before making all the changes:

  • Remove empty price filter
  • Update minimum WC version to 9.6

@jaclync jaclync added the status: do not merge Dependent on another PR, ready for review but not ready for merge. label Jan 13, 2025
@jaclync jaclync changed the title [Woo POS] Replace product/variation local filtering with WC 9.6+ API support with page size 25 [Woo POS] Bump minimum required WC version to 9.6, replace local products filters with downloadable parameter and page size 25 Jan 15, 2025
@jaclync jaclync changed the title [Woo POS] Bump minimum required WC version to 9.6, replace local products filters with downloadable parameter and page size 25 [Woo POS] Bump minimum required WC version to 9.6, replace local products filters with downloadable parameter, page size 25 Jan 15, 2025
@jaclync
Copy link
Contributor Author

jaclync commented Jan 15, 2025

WC 9.6 is still not publicly available as of today. As I'm AFK after this Friday, I'm trying to get the PR ready for merge first and it can be merged when 9.6 is in GA.

@staskus it's not urgent, this PR is ready for review again with the changes in #14843 (comment).

@jaclync jaclync requested a review from staskus January 15, 2025 07:45
@jaclync
Copy link
Contributor Author

jaclync commented Jan 16, 2025

Unit tests are failing, please skip the review for now and I'll update when it's ready for review again.

@staskus
Copy link
Contributor

staskus commented Jan 16, 2025

Unit tests are failing, please skip the review for now and I'll update when it's ready for review again.

TTP education tests should hopefully succeed if you merge now with trunk.

@jaclync jaclync removed the status: do not merge Dependent on another PR, ready for review but not ready for merge. label Jan 17, 2025
@jaclync
Copy link
Contributor Author

jaclync commented Jan 17, 2025

Ready for review now! A test case failing from the removal of the price filter was updated in 8916a21.

Copy link
Contributor

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

  • POS only available from 9.6
  • Downloadable filtered
  • No price products shown

We'll need to implement additional handling for these no price or zero price products to finish the order.

@joshheald
Copy link
Contributor

@staskus thanks for the review; I think we're waiting to merge until we're sure 9.6 is released.

We'll need to implement additional handling for these no price or zero price products to finish the order.

We discussed this last week – I think all that's needed is:

  1. Don't start a card payment if the order total is 0.
  2. Ensure cash payments feature flag is enabled before variable products.

In future, we could optimise by adding a Mark order complete button on free orders, rather than requiring merchants to open the cash flow.

Context: p1736742009959369-slack-C070SJRA8DP

@iamgabrielma
Copy link
Contributor

iamgabrielma commented Jan 21, 2025

2. Ensure cash payments feature flag is enabled before variable products.

👀 Let me know if I'm holding this one by having the flag disabled, it can be enabled right away as soon as we merge this PR, as the rest it's just minor UI details.

To retain the ability to turn off the feature flag for variable products, we should only use the higher minimum WC version when the flag is enabled.

If we disable the flag, downloadable products are still filtered out by local filters, and it’s no longer necessary to remove virtual products.
@dangermattic
Copy link
Collaborator

1 Warning
⚠️ This PR is assigned to the milestone 21.5. This milestone is due in less than 2 days.
Please make sure to get it merged by then or assign it to a milestone with a later deadline.

Generated by 🚫 Danger

@joshheald joshheald merged commit 561c13a into trunk Jan 23, 2025
12 checks passed
@joshheald joshheald deleted the feat/14834-replace-local-filtering branch January 23, 2025 08:00
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.

6 participants