--- layout: default title: line_item nav: group: Liquid Variables --- # line_item A line item represents a single line in the shopping cart. There is one line item for each distinct product variant in the cart. The line_item object can be accessed in all Liquid templates, as well as in notification email templates, the Thank You page of the checkout, as well as in apps such as [Order Printer](http://docs.shopify.com/manual/more/official-shopify-apps/order-printer). The line_item object has the following attributes: {% table_of_contents %} {% anchor_link "line_item.id", "line-id" %} Returns the id of the line item, which is the same as the id of its [variant](/themes/liquid-documentation/objects/variant/). {% anchor_link "line_item.product", "product" %} Returns the [product](/themes/liquid-documentation/objects/product/) of the line item. Example for getting a line item's image: {% highlight html %}{% raw %} {{ line_item.product.featured_image | product_img_url | img_tag }} {% endraw %}{% endhighlight %} {% anchor_link "line_item.variant", "variant" %} Returns the [variant](/themes/liquid-documentation/objects/variant/) of the line item. {% anchor_link "line_item.title", "title" %} Returns the title of this line item. line_item.title combines both the line item's product.title and the line item's variant.title, separated by a hyphen.

Input

{% highlight html %}{% raw %} {{ line_item.title }} {% endraw %}{% endhighlight %}

Output

{% highlight html %}{% raw %} Balloon Shirt - Medium {% endraw %}{% endhighlight %}
To output just the product title or variant title, you can access the title of the respective variables.

Input

{% highlight html %}{% raw %} Product Title: {{ line_item.product.title }} Variant Title: {{ line_item.variant.title }} {% endraw %}{% endhighlight %}

Output

{% highlight html %}{% raw %} Product Title: Balloon Shirt Variant Title: Medium {% endraw %}{% endhighlight %}
{% anchor_link "line_item.price", "price" %} Returns the price of the line item's variant. {% anchor_link "line_item.line_price", "line-price" %} Returns the combined price of all the items in the line_item. This is the equivalent of line_item.price times line_item.quantity. {% anchor_link "line_item.quantity", "quantity" %} Returns the quantity of the line item. {% anchor_link "line_item.grams", "grams" %} Returns the weight of the line item. Use the [weight_with_unit](/themes/liquid-documentation/filters/additional-filters/#weight_with_unit) filter to format the weight. {% anchor_link "line_item.sku", "sku" %} Returns the SKU of the line item's variant. {% anchor_link "line_item.vendor", "vendor" %} Returns the vendor name of the line item's product. {% anchor_link "line_item.requires_shipping", "requires-shipping" %} Returns true if the line item requires shipping, or false if it does not. This is set in the variant options in the Products page of the Admin. {% anchor_link "line_item.variant_id", "variant-id" %} Returns the id of the line item's variant. {% anchor_link "line_item.product_id", "product-id" %} Returns the id of the line item's product. {% anchor_link "line_item.fulfillment", "fulfillment" %} Returns the [fulfillment](/themes/liquid-documentation/objects/fulfillment/) of the line item.