Cart.liquid

From Shopify Wiki

Jump to: navigation, search

Overview

This template represents the shopping cart screen. This is where the customer can review all the items (and depending on the theme more or less details about them) that he has put in his shopping cart.

You should include a condition to check whether the shopping cart is empty or not, e.g.

{% if cart.item_count == 0 %}

Most likely you will have a listing of all the items in the shopping cart if it is not empty. This may look like this:

<ul>
{% for item in cart.items %}
  <li>{{item.quantity}}x {{ item.title }}</li>
{% endfor %}
</ul>

This would create a list of all items in the cart with a leading number saying how many of each item are in the cart. It would also be a good idea to include the price of each item, the sum of each item (there could be several of the same kind in the cart) and of course, the subtotal of the whole cart.

Variables

In this file you have access to the following liquid variables:

Advanced Modifications