Item price is $0 when redirecting to the cart right after adding a new variation

VincentDamour
Shopify Partner
2 0 0

Hello there,

I have a problem with my code. I create a new variation with the API, add it to the cart then redirect to the cart page. The cart page will then contain the newly added item, but with a price of $0. If a wait a little bit or refresh, the price will be set correctly. I feel like Shopify needs to process something before making the price available. I know I can fetch cart.js until the price is okay, but I was wondering if there is any other way to wait for the price to bet set before redirecting to the cart page.

Thank you,

Vincent

0 Likes