Cart Not Showing Product in it until it's been refreshed

Solved

Cart Not Showing Product in it until it's been refreshed

Ladymia
New Member
4 0 0

When ever a product is added to cart, if I hover on the cart icon it shows the product but when I click on the icon and it takes me to the cart full page it won't display any products until I refresh the page.

 

What do I do on that!

Accepted Solution (1)

azamgill
Shopify Partner
325 47 76

This is an accepted solution.

Hey @Ladymia 

 This script should be added to your cart page's JavaScript file.

 

document.addEventListener('DOMContentLoaded', function() {
  // Refresh the cart page after it has loaded.
  location.reload();
});


Please must take a backup of your theme or try this script on a duplicate theme.

 

Thanks


 

Azam Gill
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- Encourage me ❤️

Come and visit us at Wbify

View solution in original post

Replies 4 (4)
Ladymia
New Member
4 0 0

Yes I need it

azamgill
Shopify Partner
325 47 76

This is an accepted solution.

Hey @Ladymia 

 This script should be added to your cart page's JavaScript file.

 

document.addEventListener('DOMContentLoaded', function() {
  // Refresh the cart page after it has loaded.
  location.reload();
});


Please must take a backup of your theme or try this script on a duplicate theme.

 

Thanks


 

Azam Gill
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- Encourage me ❤️

Come and visit us at Wbify
Ladymia
New Member
4 0 0

Thanks I really appreciate 

Ladymia
New Member
4 0 0

IMG_20230901_194328.jpg

This is a screenshot to explain it properly when I add my product to cart it shows I have added 1 product but when I try to click on it it shows "Your Cart Is Empty" and it can't be clicked if I try clicking it.

 

You can also try it this is the link celestialfashion101.com