-
Notifications
You must be signed in to change notification settings - Fork 120
Order Details: Adds price field to OrderItem and updates UI #577
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
Conversation
mindgraffiti
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅ unit tests
✅ code review
✅ UI testing
Thanks Matt!!
![]()
| /// - currency: a 3-letter country code for currencies that are supported in the API. e.g. "USD" | ||
| /// | ||
| func formatAmount(_ decimalAmount: NSDecimalNumber, with currency: String = CurrencySettings.shared.currencyCode.rawValue) -> String? { | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yesss thank you 👍
|
Thanks for the review @mindgraffiti !! |
Generated by 🚫 Danger |
|
Take it easy wpmobilebot! |
Reapply updates from "item price" PR (#577)
…s into fix/563-mark-as-read-notice * 'release/1.0.0' of github.com:woocommerce/woocommerce-ios: Updates from "item price" PR (#577)
This PR adds the
pricefield to the order item entities across the Networking, Storage, and Yosemite frameworks. Additionally it fixes the item price display issue on the order details and fulfillment screens:Notes:
OrderItemmodel includes price as a NSDecimalNumber. There are 2 reasons for this: 1) It makes formatting easier in the main Woo app and 2) even though the documentation claims the item price is a string, in reality, the response JSON returnspriceas a NumberpricefieldCurrencyFormatter'sformatAmount()func to accept aNSDecimalNumberas well as aString(and added some unit tests as well)Fixes: #358
Ref: #552
Testing
Here are some suggested testing steps, but feel free to test this however you want.
Build and run the app
Open the orders tab
Find an order with
Processingstatus where the line items have a quantity of 1Open the fullfillment screen
Find an order with
Completedstatus where the line items have a quantity of 1Open the item details screen
Find an order with
Processingstatus where the line items have a quantity of 2 or moreOpen the fullfillment screen
Find an order with
Completedstatus where the line items have a quantity of 2 or moreOpen the item details screen
@mindgraffiti and/or @astralbodies Could either of you give this PR a 👀 ? Thanks!!