mini cart not update while i’m adding to cart the product. but when refreshing the page it will update the minicart on the product. where I need to check the files.
Topic summary
A Shopify developer is experiencing an issue where the mini cart doesn’t update immediately after adding a product—it only refreshes when the page is reloaded.
Root Cause Identified:
- The product page is built using a page builder app (DHCC theme)
- This conflicts with the standard cart update functionality
Attempted Solution:
- Code provided to refresh cart using
fetchto retrieve cart data and triggerShopify.onItemAddedToCart(cart) - Developer tried implementing this with a click event listener on
.gp-button-basewith 1000ms timeout
Current Problem:
- The code runs but doesn’t actually update the cart display
- Developer is struggling with the
Shopify.onItemAddedToCartmethod, specifically how to obtain the cart timeline object needed for this function - Seeking alternative code solutions or clarification on proper implementation
Status: Unresolved—developer needs working code to trigger cart UI update after add-to-cart action in page builder context.
Hi @suresh-prevaj
Can you tell me which theme you are having this issue and URL of the store.
https://www.darkhorsecoffeecompany.com/
theme : DHCC
Hi @suresh-prevaj
Upon checking i found that the product page is made with page builder app, That’s why the cart is not working.
yes. i got this. is there any possible to refresh the cart after add to cart. on the js.
Hi @suresh-prevaj
You can use the below code to refresh the cart
for this code i’m using on the console. but it doesn’t work. or how can i use the above mentioned code. also where i to place this code. js code
the code doesn’t update the cart. it’s running while clicking the addtocart. Is there any alternative code. please let me know.
for this code is work on the website. but it has problem Shopify.onItemAdded(cart); for this line need the cart itemline object. how i get this cart itemline.