Cart and checkout cache issue

Solved

Cart and checkout cache issue

Ecommerce5
Shopify Partner
11 0 3

We are currently encountering an issue regarding our cart attributes and the checkout page. Specifically, we have observed that after adding certain attributes on the cart page and proceeding to the checkout page, if a user navigates back to the cart page to modify the attributes without completing the order, the old attributes are still retained when the user eventually proceeds to complete the order on the checkout page.

 

The inconsistency between the displayed attributes on the cart page and the ones stored during checkout creates confusion for users. We need to ensure that the most recent attribute selections are accurately reflected on the checkout page, even if changes were made on the cart page before completing the order.

 

E.g ->

- Assume cart attribute: isDeliveredSaturday.

- First User selects the attribute 'Yes' and goes to the checkout page

- User comes back to the cart page again without completing the order and decides to change the attributes to 'No'.

- User selects the 'No' and completes the order.

- on our order dashboard, the attribute saved is 'Yes', whereas It should be 'No'.

   

Accepted Solution (1)

JBagdonas
Shopify Partner
2 1 2

This is an accepted solution.

Hi @Ecommerce5 ,

 

I was able to solve this in my situation by deleting a local storage item with the name "__ui" that was being created on the checkout page. I put this line of code in the script tag in the cart template before any code that makes updates to cart attributes. 

 

 

localStorage.removeItem("__ui")

 

 

Now when users navigate back to cart from the checkout, the right version of the cart gets loaded. 

View solution in original post

Replies 3 (3)

Guleria
Shopify Partner
3397 677 958

Hello @Ecommerce5 ,

 

That sounds completely strange. 
btw if you are using app for it then ask app support about it.
and if you are using custom code ask your developer to update the cart attribute on change of the checkbox. 

Thanks

- If helpful then please Like and Accept Solution.
- Drop an email   if you are looking for quick fix or any customization ( paid services )
- Email: guleriathakur43@gmail.com
- Try GEMPAGES a great page builder

JBagdonas
Shopify Partner
2 1 2

I am having the same exact issue. I am posting a cart attribute update (delivery date from a datepicker) from the cart page. When the user goes to checkout, then navigates back to the cart page, the cart reverts back to old attributes. Also the checkout must be receiving the cart object with old attributes because a delivery customization that I had setup via an app called 'Shipfy' is behaving as if it's receiving the wrong data. 

 

It's strange because on first update of cart attributes, i.e. after say clearing browser cache or local storage,  It works fine. When trying to make additional updates, i.e. the customer changes the ship date and a new cart attribute update request is posted after the initial one, the problem occurs. 

 

Maybe a caching issue? trying to find a work around. 

JBagdonas
Shopify Partner
2 1 2

This is an accepted solution.

Hi @Ecommerce5 ,

 

I was able to solve this in my situation by deleting a local storage item with the name "__ui" that was being created on the checkout page. I put this line of code in the script tag in the cart template before any code that makes updates to cart attributes. 

 

 

localStorage.removeItem("__ui")

 

 

Now when users navigate back to cart from the checkout, the right version of the cart gets loaded.