3.8 KiB
layout, title, nav
| layout | title | nav | ||
|---|---|---|---|---|
| default | cart |
|
cart
The cart object has the following attributes:
{% anchor_link "cart.attributes", "cart-attributes" %}
cart.attributes allow the capturing of more information on the cart page. This is done by giving an input a nameattribute with the following syntax:
Shown below is a basic example of how to use an HTML input of type "text" to capture information on the cart page.
cart.attributes can be accessed in order email templates, the Thank You page of the checkout, as well as in apps such as Order Printer.
Input
Output
For more examples on how to use cart attributes, see Ask a customer for additional information.
{% anchor_link "cart.item_count", "cart-item_count" %}
Returns the number of items inside the cart.
Input
Output
{% anchor_link "cart.items", "cart-items" %}
Returns all of the line items in the cart.
{% anchor_link "cart.note", "cart-note" %}
cart.note allows the capturing of more information on the cart page.
This is done by submitting the cart form with an HTML textarea and wrapping the cart.note output.
{% block "note" %}
There can only be one instance of {% raw %}{{ cart.note }}{% endraw %} on the cart page. If there are multiple instances, the one that comes latest in the Document Object Model (DOM) will be submitted with the form.
{% endblock %}
cart.note can be accessed in order email templates, the Thank You page of the checkout, as well as in apps such as Order Printer. For examples on how to use cart notes, see Ask a customer for additional information.
Input
Output
{% anchor_link "cart.total_price", "cart-total_price" %}
Returns the total price of all of the items in the cart.
{% anchor_link "cart.total_weight", "cart-total_weight" %}
Returns the total weight of all of the items in the cart.