Solved

Check if a cart has been converted

Pregno
Visitor
2 0 1

Hi,

 

I'm building a custom storefront application and I'm using the Storefront Graphql API for let the user interact with the cart.

When the user start the checkout process, it will be redirect to the Shopify checkout flow, with the URL taken from the cart.

Once the checkout is over and successful, I would like to create a new cart, but for doing this I need to be sure that the previous cart has been converted, is there any property that can I use for this purpose?

 

Thank you

 

Andrea

Accepted Solution (1)

Luke_K
Shopify Staff
402 66 100

This is an accepted solution.

Hey @Pregno 

 

So by 'converted' I'm assuming you mean that the cart is converted to => checkout => which then becomes an order. 

 

Shopify's Storefront GQL cart is actually deleted by Shopify when the customer in question completes the checkout (docs). You might want to check out the BuyerIdentity too as a way of ensuring each cart is an individual one if you'd really like,  but yes, it seems that Shopify would delete the cart when the corresponding checkout is 'turned into' an order. Hope that helps!

| Shopify |
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution!

View solution in original post

Replies 2 (2)

Luke_K
Shopify Staff
402 66 100

This is an accepted solution.

Hey @Pregno 

 

So by 'converted' I'm assuming you mean that the cart is converted to => checkout => which then becomes an order. 

 

Shopify's Storefront GQL cart is actually deleted by Shopify when the customer in question completes the checkout (docs). You might want to check out the BuyerIdentity too as a way of ensuring each cart is an individual one if you'd really like,  but yes, it seems that Shopify would delete the cart when the corresponding checkout is 'turned into' an order. Hope that helps!

| Shopify |
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution!
Pregno
Visitor
2 0 1

Thanks,

 

I've noticed this behaviour, I was probably recreating the cart due tu a bug.