What does `cart.item_count` return for this cart? 🛒 ```liquid <!-- Cart contains: - 2x T-shirt - 3x Mug - 1x Hat --> {{ cart.item_count }} ```

### Explanation `cart.item_count` returns the total quantity of all items: ```liquid {% for item in cart.items %} {{ item.product.title }}: {{ item.quantity }} {% endfor %} {{ cart.item_count }} {{ cart.items | size }} ``` Key points: - Counts total quantities, not unique products - In example: 2 + 3 + 1 = 6 items - Returns integer, not float - Updates automatically with cart changes (but needs page reload)

Answer Options:

  • 3 (number of unique products)
  • 6 (total quantity of all items)
  • 6.0 (float number)
  • 3.0 (float number)
Shopify Free Test
← PreviousQuestion 1 of 1Finish →
00
← PreviousFinish →
Copyright ©Michael Bollin. Found some mistake?[email protected]