Issue with Bundled Section Rendering not responding

Hi Shopify Community,

I’m currently implementing a dynamic cart update using the Shopify Ajax API and am encountering an issue where the cart items, the cart icon bubble, don’t visually update without a page reload after a successful POST request.

Here is the code I’m using to update the cart:

await postToCart('cart/add.js', {
    items: [{
      quantity: 1,
      id: VARIANT_ID,
      properties: { _custom: true, price }
    }],
    sections: "cart-items,cart-icon-bubble,main-cart-items,cart-footer",
    sections_url: "/cart"
  });

I have tried all variations of the sections param & sections_url: “/cart”

  • sections: "cart-items", "cart-icon-bubble" , "main-cart-items", "cart-footer",
  • sections: ["cart-items,cart-icon-bubble,main-cart-items,cart-footer"],
  • sections: ["cart-items", "cart-icon-bubble" , "main-cart-items", "cart-footer"],
  • and many more but to no avail

I’m referencing the Bundled Section Rendering documentation to update the cart sections dynamically, but it’s not triggering a re-render without a page refresh.

Could you provide guidance on how to properly trigger the dynamic updates for these sections, so the cart visually reflects the changes?

UPDATE → SOLUTION SOLVED.

comment here if anyone needs

I am also encountering issues with the section rendering API. How did you solve this?

Send your code block here. Let’s take a look at it

I have a scenario where it work on the live version but not on the local development…

But it’s using the formData object. I have no clue why this is happening