Hi,
Not sure if this is the best category, since ultimately it's the Swift template that needs to be fixed, or Development, since the ViewModel is returning misleading data IMO.
Consider this order and cart with Swift test data.
- Add 3x "Test No Discount" product
- Add 5x "Test Discount produt" product
- Add "winther21" as voucher code
- Configure Taxes to be 10% for all countries
This will give you an order with taxes and 2 types of discounts (order and product). We are seeing some problems with the ViewModel (OrderDetails) version:
- The orderline total does not consider the discount
Notice that in Cart it's $450.00, but when it becomes an Order it's $500.00
(I believe this should be the Orderline.PriceBeforeDiscount, not the Orderline.Price property in the ViewModel)
- The Orderline.TotalDiscount is never null
(I believe this is a template validation to not render $0.00)
- The subtotals are different between cart and order
- Cart = $800.00 with strikethrough and $816.26 as the subtotal (confusing)
- Order = $800
- Considering the taxes should not be part of the subtotal, the actual value should be $750
(Sum of all orderlines of type "product + productDiscounts + gift cards + fixed" OR sum of all orderlines excluding types "taxes + orderDiscounts")
- In the Order Details, the OrderDiscounts is duplicated
(notice how it's rendering "VIP Discount" twice)
- In the Order, I cannot get the BeforeDiscount UnitPrice (and consequentely the amount of Discount and/or percentage)
(there is no such information in ViewModels)
- Delivery and Payment fees are sorted differently between Cart and Orders
(this is a simple template fix)
- The order does not render the voucher code that was used
(this is a simple template fix)
- I had a hard time (it was impossible actually) in the Order Details to determine
- The ParentOrderlineID (it's missing in ViewModels)
- Using the attached Cheat Sheets, I was also able to confirm that the orderlines are sorted differently between cart and order. I don't know if that would be automatically fixed with ParentOrderlineId, but certainly threw me off for a while. Would be nice if they were consistent
I was able to get to some of these conclusions by:
- Placing an order using the instructions above
- Recreating the cart
- Using the attached cheat sheets
- Create 1 page for each
Hope this all makes sense. Let me know what questions you may have.
Best Regards,
Nuno Aguiar