New Shopping Cart behavior
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-02-2018 11:12 AM
We upgraded to Kingston from Helsinki and we're seeing that the cart is now behaving differently.
In particular in the old version a user had only one cart (called default) and there were two behaviors of interest to me:
- When the order was processed the cart was destroyed,
- When you clicked Order Now, all items in the cart were processed
In the new version we're seeing that the default cart is manipulated like before, but:
- When an order is processed, a new cart is automatically created (i'll call it a temporary cart) with name 'cart_<sysid>'
- If you click Order Now, you only request the item you are looking at and the items in the default cart are left there
- If you abandon the temporary cart before checkout, the cart isn't destroyed
- When you check out normally, the cart is not destroyed and instead just emptied
Can anyone point me to the documentation where these changes are described? Or if you can point me to the code that does this I could try to understand it and see how to work around it.
Thanks
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-02-2018 11:28 AM
This touches on the change;
However, your explanation of the change is more complete.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-04-2018 10:33 AM
I remember reading those release notes and since the changes were flagged for the Service Portal and they don't really talk about changes to how the cart works.
An update to what I said before on point 4 of new behavior: When you check out normally, the default cart is destroyed (i'll update the original to reflect this.
We have some scripts that look at carts and having more than one cart per user is messing with them... Our current workaround is to disable the option to 'order now' so that the temp carts are not created but I'm still researching and trying to understand all the changes (I still want to know if there are other changes that I am not aware of).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-04-2018 11:02 AM
I'll try to describe better what I found out after additional testing:
Case A
If we go to the catalog and request an item by selecting 'Order Now' – the item is added to both the cart and a temporary cart is created with the item, the temp cart is processed and destroyed after checkout. The item is deleted from the default cart.
Case B
If we add multiple items to the cart and order them through ‘Proceed to Checkout’ – no temporary cart is created and instead the default cart is processed and destroyed.
Case C
- If we add an item, select 'order now' and back out (continue shopping) while on the checkout screen the temporary cart is abandoned, then...
- If we proceed to checkout right away (with the item we selected originally), the default cart is processed and destroyed, or
- If we add a second item and then proceed to checkout the default cart is processed and destroyed, or
- If we select another item and select order now, the item is added to both the default cart and to a new temporary cart (temp2).
- If we back out, temp2 cart is abandoned but default cart keeps the two items we selected.
- If we checkout, item2 is requested and temp2 cart is destroyed and the item is removed from the default cart.
- If we select a second item that is the same as the first and we ‘order now’, the temporary cart that had been abandoned appears to be reused, but no, a new one is created but with the same name as temp1
tl;dr - When you're about to request an item, regardless of how you order it (order now or add to cart) the item will be added to the default cart. If you select 'order now' a temporary cart is created (cart_<item_sys_id>) and when you check out this temporary cart is destroyed and the item that was requested is removed from the default cart; if instead you decide to continue shopping you abandon this temporary cart and it will only be destroyed when the item it shares sys_id with is requested through 'order now' again.
Hope this helps people out there... for us it explains why some of our users complained about the 'requested for' widget we have on the catalog didn't revert back to them sometimes.