Dawn Theme Cart page Refresh/reaload On Quantity Change

Topic summary

Goal: make the Dawn theme cart page automatically refresh when quantity changes or an item is removed.

Approaches proposed:

  • Use Shopify Section Rendering API to re-render cart sections asynchronously (requires adjusting/rebuilding Dawn’s cart logic).
  • Add custom AJAX that detects quantity changes or item removals and triggers a UI update or refresh.
  • Quick fix: in cart.js, locate the cart update publish call (publish(PUB_SUB_EVENTS.cartUpdate, {…})), then add window.location.reload() immediately after it to force a full page reload on any cart update. An attached image shows the exact placement.

Notes:

  • Section Rendering/AJAX approaches enable partial updates without reloading the entire page, which is generally more performant and user-friendly.
  • The window.location.reload() method is simpler but incurs a full-page refresh on every change.

Status: A concrete code-level step is provided, but there’s no confirmation of implementation or success from the original poster. Discussion remains open.

Summarized with AI on December 23. AI used: gpt-5.

Hi how do i make the Dawn Theme Cart page Refresh/reaload On Quantity Change Or Item Removal?

Hi @alexharv123 . You can utilise shopify section rendering API for such purpose. So you need to rebuild dawns logic in this area.

Hi @alexharv123

You need to add Ajax code that detect whether the cart quantity changed or the item removed.

Find this code in cart.js file

publish(PUB_SUB_EVENTS.cartUpdate, { source: 'cart-items', cartData: parsedState, variantId: variantId });

Add this right below

window.location.reload()

It will look like this

Hope it helps