Skip to content

[Woo POS][Product Labels] Display stock levels for variations #15676

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

Draft
wants to merge 3 commits into
base: trunk
Choose a base branch
from

Conversation

iamgabrielma
Copy link
Contributor

@iamgabrielma iamgabrielma commented May 27, 2025

Closes WOOMOB-495

Description

As continuation of #15647 , this PR adapts the POSVariation model to use manageStock, stockQuantity, and stockStatusKey properties. As well as render them on the view (final UI TBD)

Testing

  • Create a variable product with different variations in different stages of managed and non-managed stock. For simplicity when testing you can load POS for https://indiemelon.mystagingwebsite.com/ and look for "Variable product with managed stock" product, which contains these.
  • Observe that a variation shows:
    • If not managed, just In Stock or Out of Stock.
    • If managed, the number of items in stock, or Out of Stock.

Simulator Screenshot - iPad mini (A17 Pro) - US store - 2025-05-27 at 17 29 01

  • You can play with those in wp-admin and exit/enter POS or PTR to fetch the latest state. This is under Products > "Variable product with managed stock" > Edit > Variation > Click on the row to edit stock status or stock levels
Screenshot 2025-05-27 at 17 38 22
  • When feature flag inventoryProductLabelsInPOS is disabled we shouldn't see any changes in the variation cards

  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

@@ -18,15 +28,38 @@ struct POSStockFormatter {
}
}

private static func label(for key: String) -> String {
switch key {
case "instock":
Copy link
Contributor Author

Choose a reason for hiding this comment

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

StockStatusKey happens to be in Networking at the moment, so we cannot use it directly in this target. I'll update the usage from String to an enum with WOOMOB-517 when testing/handling undocumented stock statuses.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually we can, not sure why Xcode was not finding it on a first go, as I can see the typealias it in Yosemite and compiles if I switch it despite the warnings.

@iamgabrielma iamgabrielma added type: task An internally driven task. feature: order details Related to order details. feature: POS labels May 27, 2025
@iamgabrielma iamgabrielma added this to the 22.5 milestone May 27, 2025
@iamgabrielma iamgabrielma marked this pull request as ready for review May 27, 2025 10:49
@iamgabrielma iamgabrielma requested a review from staskus May 27, 2025 10:49
@wpmobilebot
Copy link
Collaborator

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

App NameWooCommerce iOS Prototype
Build Number30091
VersionPR #15676
Bundle IDcom.automattic.alpha.woocommerce
Commit3130e26
Installation URL4is8l2q7qr6e0
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@iamgabrielma
Copy link
Contributor Author

No need to review this one for the moment @staskus as we might need to move this project for the time being. I'll switch it back to draft for now, and close it in a few days if we go ahead with the decision 👍

@iamgabrielma iamgabrielma marked this pull request as draft May 28, 2025 10:09
@wpmobilebot wpmobilebot modified the milestones: 22.5, 22.6 May 30, 2025
@wpmobilebot
Copy link
Collaborator

Version 22.5 has now entered code-freeze, so the milestone of this PR has been updated to 22.6.

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

Successfully merging this pull request may close these issues.

2 participants