Menu Close

Get Support From ShopWired Close

All Systems Are Operational

Subscribe To Updates
Prefer To Live Chat? Chat directly with ShopWired support Available 9.00am to 7.00pm Monday to Friday
11.00am to 5.00pm Saturday
Quickest response time

Send A Message
Response within 24 hours

Menu Close

Menu

Basket items

The basket.items array returns the line items within a visitor's shopping basket.

The basket.items array will return the following attributes when used within {% for item in basket.items %}:

item.id

Returns the unique platform ID of the item in the customer's basket and any variation/options selected.


item.product

Returns the product object.


item.quantity

Returns the quantity of the individual product added to the basket.


item.price

Returns the price the customer will pay for the item. This price will include any discounts applied to the customer's order (like voucher codes). For the original price of the item (before discounts are applied) please refer to the 'original_price' variables listed below.


Including and excluding tax

The account's B2B settings will determine whether the item.price variable is returned displaying the price including or excluding VAT.

Additional price variables are available to display the price regardless of those settings.

item.price_including_tax

item.price_excluding_tax


item.original_price

Returns the original price of the item. Like the item.price variable, the account's B2B settings determine whether this price is returned including or excluding VAT. Additional variables are available to display the price regardless of the setting.

item.original_price_excluding_tax

item.original_price_including_tax


item.total

Returns the item.quantity x item.price.


item.remove_url

Returns the URL the visitor needs to visit in order to remove the item from their basket. Visiting the URL will return the customer to the current page.


item.comments

Returns any comments attached to the item in the basket when the item was added to the basket (when the product form was submitted).


item.is_gift_voucher

Returns whether the item in the basket is a gift voucher.


item.options

Returns an array of the options (variations) chosen when the item was added to the basket.

{% for name, value in item.options %}
    {{ name }}: {{ value }}
{% endfor %}

returns...

Size: Small

{{ name }} returns the name of the variation type (e.g. 'Size').

{{ value }} returns the option chosen (e.g. 'Small').


variation_id

Returns the ID of the variation combination selected when the item was added to the basket.


item.choices

Returns an array of the product choices chosen when the item was added to the basket.

{% for choice in item.choices %}
    {{ choice.name }} ~ {{ choice.value }} ~ {{ currency_value(choice.price) }}
{% endfor %}

returns...

Size ~ Small ~ £10.00

{{ choice.name }} returns the name of the product choice type (e.g. 'Size').

{{ choice.value }} returns the option chosen (e.g. 'Small').

{{ choice.price }} returns the additional cost of the option chosen (e.g. '10.00').


item.extras

Returns an array of the product extras chosen when the item was added to the basket.

{% for extra in item.extras %}
    {{ extra.name }}: {{ currency_value(extra.price) }}
{% endfor %}

returns...

Mobile phone charger: £25.00

{{ extra.name }} returns the name of the extra chosen.

{{ extra.price }} returns the price of the extra chosen.


item.weight

Returns the weight of the item in the basket (it is not affected by quantity).