Developer forum

Forum » Swift » Swift Order Details (ViewModel) issues

Swift Order Details (ViewModel) issues

Nuno Aguiar Dynamicweb Employee
Nuno Aguiar
Reply

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:

  1. 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)
     
  2. The Orderline.TotalDiscount is never null
    (I believe this is a template validation to not render $0.00)
     
  3. 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")
       
  4. In the Order Details, the OrderDiscounts is duplicated
    (notice how it's rendering "VIP Discount" twice)
     
  5. 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)
     
  6. Delivery and Payment fees are sorted differently between Cart and Orders
    (this is a simple template fix)
     
  7. The order does not render the voucher code that was used
    (this is a simple template fix)
     
  8. 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

Cart.jpg Order.jpg

Replies

 
Nuno Aguiar Dynamicweb Employee
Nuno Aguiar
Reply

Hi Oleg,

 

Calling you out specifically, since you're in the QA department, can you repro the scenario above? I really need some acknowledgement and eventually some DevOps Ids to keep track of.

 

I'd appreciate your help on this.

 

Best Regards,

Nuno Aguiar

 
Nicolai Pedersen
Reply

Sent to Swift QA for verification.

 
Nuno Aguiar Dynamicweb Employee
Nuno Aguiar
Reply

Thanks Nicolai

 
Nuno Aguiar Dynamicweb Employee
Nuno Aguiar
Reply

Hi,

 

Any news from QA on this?

 
Merethe Vrå Andersen Dynamicweb Employee
Merethe Vrå Andersen
Reply

Hi, 

Sorry for the late answer. The thread was forgotten due to easter and illness.
I have created bug 7680 for Swift in order to unify the order recipt and order detail page in customer center (issue 1,2,3,6,7).
I can't reproduce #4 (check screenshot).

Regarding the missing view model issues (5+8), I have created 7681 (I need these to be verified by our developer though).

Kind regards,
Merethe

cartdetail.jpg
 
Nuno Aguiar Dynamicweb Employee
Nuno Aguiar
Reply

Hi Merethe,

 

Thanks. Number 4 must have been fixed since this was reported. I'll be looking forward for the other changes. Hopefully the cheatsheets I attached initially will help the backend developers consider the missing data.

 

Best Regards,

Nuno Aguiar

 
Mikkel Hammer
Mikkel Hammer
Reply

Hi,

Any progress on this issue?
We're experiencing the same issue's when getting cart information through the WebApi, and are expecting it's the same piece of code that would solve it for us.

Best regards,
Mikkel Hammer

 

 
Nicolai Pedersen
Reply

Hi Mikel

Yes - it is on its way (#7681 for DW and #7680 for Swift).

Both items are in progress 

BR Nicolai

 
Mikkel Hammer
Mikkel Hammer
Reply

Hi Nicolai,

That's great to hear! Looking forward to these fixes

Best Regards,
Mikkel Hammer

 

You must be logged in to post in the forum