Hello community!
Using the dawn theme. I have previously replaced the cart icon with text. Now, I would like to have brackets displaying the number of items in the cart next to the text. Examples = Cart (0) or Cart (2)
Attached is an example of a website using this design.
Thank you very much!
You can call {{ cart.item_count }} to get the number of items in the cart.
Hi @MagdalenaBB ,
This is Theodore from PageFly - Shopify Page Builder App.
To display the cart text with item count in your Dawn theme:
- Edit your theme code (Online Store > Themes > Edit code).
- Find the template file controlling the cart icon/text (e.g., cart.liquid or header.liquid).
- Modify the cart text code (e.g., Cart ({{ cart.item_count }})).
- Save changes.
This injects the {{ cart.item_count }} variable to dynamically update the cart item count next to the text.
Best regards,
Theodore | PageFly
1 Like