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

[Shipping labels] Add support for retrieving products and product variations related to the order items #13964

Merged

Conversation

rachelmcr
Copy link
Contributor

Part of: #13550
⚠️ Depends on #13962 ⚠️

Description

This creates a separate data source for the items to ship in the new Woo Shipping extension label creation flow, and provides the products and product variations related to the those items.

Here's what the data source does:

  • It separates the logic for what data to display for items to ship (handled by the view model) from the logic for what product/variation data corresponds to the items in the order (handled by the data source) and retrieving that data from storage/remote.
  • It makes it easier to mock the data for the view model in unit tests (by injecting a mock data source).

Testing information

For now, this should not change the behavior so we can test with the same steps as #13962:

  1. Install and set up the Woo Shipping extension on your store.
  2. Build and run the app with the revampedShippingLabelCreation feature flag enabled.
  3. Create an order with the processing status and at least one physical product.
  4. In the order details, select "Create Shipping Label."
  5. In the shipping label flow, confirm the items section appears with the following details:
    1. The correct total number of items in the order (taking into account items with a quantity >1).
    2. The correct total price for all items in the order. (Note that the weight shown is a placeholder for now and will always say 1 kg.)
    3. Expand the items section and confirm there is a row for each item in the order. (Note that for now virtual items will still be shown, but those will be filtered out in a future PR.)
    4. Confirm that each row shows the correct quantity, item name, item price (per unit), and a list of variation attributes for product variations.

Screenshots

Simulator.Screen.Recording.-.iPhone.15.Plus.-.2024-09-13.at.15.23.02.mp4

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

@rachelmcr rachelmcr added the feature: shipping labels Related to creating, ordering, or printing shipping labels. label Sep 13, 2024
@rachelmcr rachelmcr added this to the 20.5 milestone Sep 13, 2024
@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 Numberpr13964-25c626a
Version20.3
Bundle IDcom.automattic.alpha.woocommerce
Commit25c626a
App Center BuildWooCommerce - Prototype Builds #10872
Automatticians: You can use our internal self-serve MC tool to give yourself access to App Center if needed.

Base automatically changed from issue/13550-shipping-label-item-vms to trunk September 13, 2024 17:18
@rachelmcr rachelmcr merged commit 131e1b1 into trunk Sep 13, 2024
19 checks passed
@rachelmcr rachelmcr deleted the issue/13550-shipping-label-items-products-resultscontrollers branch September 13, 2024 17:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature: shipping labels Related to creating, ordering, or printing shipping labels.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants