Skip to content

[Order Details] Display multiple shipping lines in order details #12823

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

Merged
merged 6 commits into from
May 23, 2024

Conversation

rachelmcr
Copy link
Contributor

Closes: #12582
⚠️ Based on #12822 ⚠️

Why

This adds support (behind a feature flag) for showing multiple shipping lines in order details.

Previously, we only supported showing the first shipping line on an order. Now, we show a Shipping section with all the shipping lines on an order.

How

  • Adds a new feature flag for multiple shipping lines support.
  • Adds a HostingConfigurationTableViewCell<Content: View> view that wraps a SwiftUI view in a UITableViewCell. This uses a UIHostingConfiguration instead of UIHostingController; it can be used when HostingTableViewCell<Content: View> can't be used because the parent view isn't available in the current context.
  • Adds the new shipping section:
    • Adds the new section and row to OrderDetailsDataSource, and configures each row based on the corresponding shipping line on the order.
    • Updates OrderDetailsResultsControllers to include a shipping methods ResultsController, to fetch the list of shipping methods for the store. This allows us to get the name of the shipping method corresponding to each shipping line on the order.
    • Updates OrderDetailsViewModel to register the new cell and sync the shipping methods for the store (in case they haven't been synced before).

Testing instructions

With the feature flag disabled:

  1. Build and run the app.
  2. Open an order with multiple shipping lines.
  3. Confirm the shipping line notice appears and the shipping method for a single shipping line is shown in the Customer section.

With the feature flag enabled:

  1. Build and run the app.
  2. Open an order with multiple shipping lines.
  3. Confirm the shipping line notice does NOT appear and a shipping section appears with all shipping lines on the order.

Bonus:

  • Repeat the steps above for an order with a single shipping line.
  • Repeat the steps above for an order without shipping lines, and confirm no shipping section appears.

Screenshots

Before After
Simulator Screenshot - iPhone 15 Plus - 2024-05-20 at 17 21 47 Simulator Screenshot - iPhone 15 Plus - 2024-05-23 at 16 42 32

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

@rachelmcr rachelmcr added the feature: order details Related to order details. label May 23, 2024
@rachelmcr rachelmcr added this to the 18.8 milestone May 23, 2024
@wpmobilebot
Copy link
Collaborator

wpmobilebot commented May 23, 2024

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 Numberpr12823-64057fa
Version18.7
Bundle IDcom.automattic.alpha.woocommerce
Commit64057fa
App Center BuildWooCommerce - Prototype Builds #9224
Automatticians: You can use our internal self-serve MC tool to give yourself access to App Center if needed.

Base automatically changed from issue/12582-shipping-line-row-view to trunk May 23, 2024 16:26
@rachelmcr rachelmcr merged commit 71e4acb into trunk May 23, 2024
22 checks passed
@rachelmcr rachelmcr deleted the issue/12582-order-details-shipping-lines-swiftui branch May 23, 2024 16:41
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

UI to display multiple shipping lines Order Details
2 participants