Is it possible to get the cart id/ cart_token in a checkout ui extension?

I am working on a checkout ui extension that tracks different events from user. I want to be able to use the cart_token as the identifier of all the events of a user from store to checkout.

I was able to get checkout_token, but it is different from the cart token.

If you guys have any different idea to uniquely identify a cart object from theme to checkout

1 Like

Hello @fourlinecode

Currently, there is no option to directly retrieve the cart token in the checkout extension. If you need to access the cart token, you can add it to the cart attributes and retrieve it using the useAttributes hook.

If the solution presented meets your needs and addresses your query effectively, I encourage you to accept it as the chosen answer. This will acknowledge the support you received and aid fellow community members in identifying reliable and effective solutions for their similar concerns.
Thank you.