Refresh minicart info

Hello everyone,

I am trying to inject an addToCart button that acts like a native one in vtexio.

When I use a POST request in said button, according to here it actually adds the item, however it does not update the minicart information. After adding a product from a native button or refreshing the page, the minicart correctly shows the item added through the request.

I have also tried with a GET request to /checkout/cart/add?sku=${sku}&qty=${qty}&seller=${seller}&redirect=false&sc=${sc} in which the same behavior occurs.

So I guess I got the adding part right, but I couldn’t figure it out how to refresh the minicart information.

Important note:

  • I do not have access to the native code, the purpose here is to inject the button through javascript from an outside script.

Thank you!

Hi! Did you find a solution?