Menu Close

Get Support From ShopWired Close

All Systems Operational

Subscribe To Updates
Prefer To Live Chat? Chat directly with ShopWired support Quickest response time

Prefer To Phone?

Call us on 0330 111 2024 (free from landlines and mobiles)

Available 9.30am to 5.30pm Monday to Friday


Send A Message
Response within 24 hours

Menu Close

Menu

Product

The product object has the following attributes:

product.id

Returns the unique platform ID for the product.


product.title

Returns the title/name of the product.


product.brand

Returns the title/name of the brand the product is assigned to.

Use the brand object to return other information.


product.photo_url

Returns the URL of the main (1st) photo/image for the product.

You can use the product.photos array (described below) to return other photos.


product.photo_description

Returns the ALT text for the main (1st) photo/image for the product.


product.photos

Returns an array of the product's photos/images.

{% for photo in product.photos %}
    <img src="{{ photo.url }}" alt="{{ photo.description }}">
{% endfor %}

photo.url returns the URL of the product photo/image.

photo.description returns the ALT text for the product photo/image.


product.raw_video_embed_code

Returns the video embedding code set for the product.


product.video_embed_code

Returns a modified version of the video embedding code set for the product (just outputting the URL within the embed code).


product.description

Returns the description of the product. Use the raw filter so that the variable is not escaped.

With the tabbed product descriptions extension enabled further variables are available:

product.description2

product.description3

product.description4

product.description5


product.sku

Returns the SKU code for the product.

Note: If the product has variations which have SKU codes set, the product.sku is, in effect, defunct.


product.stock

Returns an integer of the current stock quantity of the product.

Note: If the product has variations which have SKU codes set, the product.stock is, in effect, defunct.


product.in_stock

Returns true if the product is in stock (i.e. has a product SKU code set and product.stock is greater than 0).

Returns false if the product is out of stock (i.e. has a product SKU code set and product.stock is 0 or less).


products.variants_out_of_stock

If the product has variants, and a SKU code and stock quantity is set at the variant level (rather than the product level), this value will return true if all of the variants are out of stock.


product.url

Returns the relative URL of the product.

{{ product.url }}

returns...

/nike-airmax-trainers-in-white

product.price

Returns the price of the product.

You can use the currency_value function to return the price of the product to 2 decimal places and include a currency symbol, e.g.

{{ currency_value(product.price) }}

returns...

£3.58

Note: The £ symbol will replaced with whatever base currency the account is configured with or in accordance with the multi currency APP.

You can use the number_format filter to return the price to a specific number of decimal places, e.g.

&pound;{{ product.price|number_format(0) }}

returns...

£3

Note: If variations are used this value might be overwritten by Javascript.


product.sale_price

Returns the sale price of the product.


Including and excluding tax

The account's B2B settings will determine whether the product.price and product.sale_price variables are returned displaying the price including or excluding vat.

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

product.price_including_tax

product.price_excluding_tax

product.sale_price_including_tax

product.sale_price_excluding_tax


product.rrp

Returns the RRP/Compare price of the product.


product.archived

Returns true if the product is not active (i.e. has been archived).

Returns false if the product is active.


product.can_be_added

Returns true if the product can be added to the basket. A product will only be able to be added to the basket if it is not archived and is in stock.


product.new

Returns true if the product has been marked with the new indicator.


product.two_for_one

Returns true if the product has been marked with the two for one indicator (using the two for one app).


product.three_for_two

Returns true if the product has been marked with the three for two indicator (using the multi-buy offers app).


product.delivery_cost

Returns the specific delivery cost set for the product.

You can use currency_value to return the price of the product to 2 decimal places


product.free_delivery

Returns true if the product has been marked with free delivery.


product.vat_exclusive

If the account has VAT enabled and the product has been marked as zero rated for VAT, this variable will return true.


product.warehouse_notes

If the warehouse notes APP is enabled on the account and the product has warehouse notes set, this variable will return the warehouse notes.


product.categories

Returns an array of the categories a product is assigned to. (Note this is not the full category tree but the categories a product is directly assigned to).


product.tag

The tag object is available if tags are enabled on the product.


product.gtin

Returns the GTIN set for the product.


product.mpn

Returns the MPN set for the product.


product.in_wishlist

Returns true if the product is in the visitor's wishlist.


Additional properties available on the product page

product.options

Returns an array of the product variations.

{% for option in product.options %}
    {{ option.name }}
{% endfor %}

returns...

Colour 
Size 
Material

{{ option.name }} returns the name of the variation types (e.g. 'colour')

{{ option.id }} returns the ID of the variation type

option.values is an array of the available choices within a variation

{% for value in option.values %}
    {{ value.name }}
{% endfor %}

returns...

Blue 
Green 
Black 
Purple 
Orange 
Red

{{ value.name }} returns the name of the choice (e.g. 'Blue')

{{ value.id }} returns the ID of the choice


product.variations

Returns an array of the variation combinations (an alternative, rarely used, method to the above product.options array).

{% for variation in product.variations %}
    {{ variation.image_url }}
    {{ variation.values|join(' ') }}
    {{ variation.sale_price }}
    {{ variation.price }}
    {{ variation.gtin }}
    {{ variation.sku }}
    {{ variation.in_stock }}
    {{ variation.id }}
{% endfor %}

{{ variation.values }} returns the values of the variation combination e.g. Small Green Metal

{{ variation.image_url }} returns the URL of the image assigned to the variation combination

{{ variation.sale_price }} if the product has a sale price, this will return the product sale price (if a % sale is set this will return the sale price of the variation combination)

{{ variation.price }} returns the price of the variation combination

{{ variation.gtin }} returns the GTIN set for the variation combination

{{ variation.sku }} returns the SKU code of the variation combination

{{ variation.in_stock }} returns true or false depending on whether the variation combination is in or out of stock

{{ variation.quantity }} returns the stock quantity of the variation combination

{{ variation.id }} returns the ID of the variation combination

The above can be used to create a form on the product page for each variation combination, e.g.

<form action="{{ product.url }}" method="post">
    <input name="quantity" value="1" type="hidden">
    <input name="variation_id" value="{{ variation.id }}" type="hidden">
    <button type="submit">add to basket</button>
</form>

product.extras

Returns an array of the product extras.

{% for extra in product.extras %}
    {{ extra.name }}
{% endfor %}

returns...

Mobile phone charger
Car phone charger
Hands free kit

{{ extra.name }} returns the name of the extra (e.g. 'Mobile phone charger')

{{ extra.id }} returns the ID of the extra

{{ extra.price }} returns the price of the extra. Use currency_value to return the price with the currency symbol and to two decimal places, e.g. {{ currency_value(extra.price) }}.


product.related_products

Returns an array of the related products.


product.bulk_prices

Returns an array of the bulk discounted prices for the product.

{% for bulk_price in product.bulk_prices %}
    {{ bulk_price.quantity }} ~ {{ currency_value(bulk_price.value }}
{% endfor %}

returns...

2-4 ~ £3.50
5-8 ~ £3.30
9+ ~ £3.10

{{ bulk_price.quantity }} returns the quantity the customer needs to purchase to qualify for the discounted price.

{{ bulk_price.value }} returns the price of a single product when purchased at that quantity.


product.bulk_variations

Bulk discounted prices are also available for variations. product.bulk_variations returns an array of the discounts available for each variation.

{% for variation in product.bulk_variations %}
    {{ variation title }} ~ {{ bulk_price.quantity }} ~ {{ currency_value(bulk_price.value) }}
{% endfor %}

returns...

Small, Blue, Wood ~ 2-4 ~ £3.50
Small, Blue, Wood ~ 5-8 ~ £3.30
Small, Blue, Wood ~ 9+ ~ £3.10
Small, Blue, Metal ~ 2-4 ~ £3.50
Small, Blue, Metal ~ 5-8 ~ £3.30
Small, Blue, Metal ~ 9+ ~ £3.10
Large, Blue, Metal ~ 2-4 ~ £3.50
Large, Blue, Metal ~ 5-8 ~ £3.30
Large, Blue, Metal ~ 9+ ~ £3.10
...

{{ variation.title }} returns the variation choices applicable to the discount. Each individual variation choice is returned separated with a comma (as in the example above).


Product reviews

If product reviews are enabled, these can be outputted using product.reviews described here.


Product reward points

If reward points are enabled, these can be outputted with attributes described here.


Product questions & answers

If product questions & answers are enabled, these can be outputted using product.questions described here.


Product bundles

If using the product bundles app when viewing the product bundle page, the products that are part of the bundle can be outputted using the product.bundle_products array.

{% for product in product.bundle_products %}
    {{ product.title }}
{% endfor %}