How to get cart token by Shopify Liquid
by Kiet Huynh · March 18, 2020
Sell Online With Shopify
Trusted by millions of businesses worldwide
Sign up for a free trial and enjoy 3 months of Shopify for $1/month on select plans.
Cart Token is meant to be a shopping cart ID of the client in a session, that generated by Shopify when an item is added to cart. Sometime you want to get this value to check something but Shopify doesn’t support that. In fact, with a small tip you can get this value with Shopify liquid.
Let’s try with the below code.
| {% assign cart_token = cart | json | split:'token":"' | last | split:'"' | first %} |
Related
Related Posts via Categories
Looking for Shopify Experts?
Hura Apps can help you take your store to the next level
Our team of experienced designers and developers can help you create a beautiful, high-converting Shopify store that will drive sales and increase customer satisfaction. From custom design to app development and optimization, we have the skills and expertise to help you achieve your eCommerce goals.
Get in touchTags: cart Shopifycart tokenliquidliquid codeshopifyShopify liquid
You may also like...
Looks like this is not valid anymore 🙁