Posted on 12/04/2018 11:24:51
Hi Oleg,
Ok, so it there any way (without susbscribing to a ton of events) to figure out if/when something relevant in the order has changed? Cart quantity and Last modified orderline date?
By relevant I mean:
- Orderline data like names, pricing, qty
- Addresses, Voucher Code
Essentially I am looking for any data the user might enter and or be relevant to the user. My goal is store some flags in sessionStorage and render the same data in my master layout. If they don't match, it means the cart has been updated, and then we trigger an AJAX call to get all of the cart contents we need.
Currently this is benefitial when we have some Live Integration and/or because we don't want to request order tags (such as orderline loops) which can decrease performance, if the cart is the same.
We haven't started using ViewModels yet, so that could also be a solution that does not affect performance (I honestly don't know), but last I saw they, CartViewModel did not take Cart Contexts into account, which we need. Can you tell me if they do now and/or if VIewModels are better for performance than DW tags?
Best Regards,
Nuno Aguiar