Link Search Menu Expand Document

Extra

object

The extra object will behave slightly differently depending on how it is accessed.

  • When accessed through an experience slot, some methods will return a result that is specific to that given slot.
  • When accessed independently or through a product, those methods will take into account all upcoming slots on the product.

Please check the method descriptions for more details.

Attributes

extra.address

address

The address associated with this extra.

extra.booking_fee_rate

number

The extra’s booking fee rate as a decimal between 0 and 1.

extra.country

string

The name of the country for the product that this extra is part of.

extra.deposit_amount

string

deprecated

A humanized price for the extras deposit amount, if deposits are not set on the extra this will just return extra.price e.g. $250 Per Person.

Deprecated, the deposit should be calculated in Liquid, using a mixture of the extra.price and extra.product.deposit.rate.

{% assign deposit_price = extra.price.fractional | times: extra.product.deposit.rate %}
{{ deposit_price | money }}

extra.has_infinite_stock

boolean

Returns true if the extra has unlimited stock.

  • When accessed through an experience slot, it will return true if the extra has unlimited stock on the given slot.
  • When accessed independently or through a product, it will return true if the extra has unlimited stock on at least one of the upcoming slots.

extra.hero_image

Image

The hero image of the product the extra belongs to.

extra.id

string

The unique id of the extra.

extra.image

Image

The extra’s image if it has one associated.

extra.initial_stock

number

The initial stock for the extra, if the extra has unlimited inventory this will return nil.

  • When accessed through an experience slot, it will return the initial stock for the extra on the given slot.
  • When accessed independently or through a product, it will return the sum of the initial stock for the extra across all upcoming slots.

extra.modifier_groups

array of modifier groups

An array of modifier groups associated with this extra.

Note that the resulting list will encompass both pre- and post-checkout modifier groups, and therefore the use of this method in pre-checkout pages is not recommended.

For pre-checkout pages, pre_checkout_modifier_groups should be used instead.

extra.name

string

The extras name.

extra.overview_image

Image

The overview image of the product the extra belongs to.

extra.price

Price

The price of this extra in the current customer’s currency.

  • When accessed through an experience slot, it will return the price for the extra on the given slot.
  • When accessed independently or through a product, it will return the default price for the extra, managed in Experience > Extras.
{{ extra.price.fractional | money }}

This method has some deprecated behaviour. If no methods are called on the Price object that is returned from this method, then it will fallback to the legacy behaviour, which will return a string of the price, e.g. $124 Per Person. It is difficult to apply any math filters to this price string.

The behaviour of extra.price has been changed to enable math filters to be applied. It is more useful to have access to the numerical value of the price.

Deprecated method

<p>{{ extra.price }}</p>

Updated method

<p>{{ extra.price | money }} Per Person</p>

extra.pre_checkout_modifier_groups

array of modifier groups

An array of modifier groups associated with this extra that the customer must choose before checking out.

extra.prices

array of prices

An array containing the single price of this extra in the current customer’s currency.

  • When accessed through an experience slot, it will return the prices for the extra on the given slot.
  • When accessed independently or through a product, it will return the default prices for the extra, managed in Experience > Extras.
{{ assign price = extra.prices | first }}
{{ price.fractional | money }}

extra.product

Product

The product this extra belongs to.

extra.promotion

Promotion

The extra’s current active promotion if there is one.

extra.remaining_stock

number

The remaining stock for the extra. If the extra is manually marked as ‘Sold Out’ this will return 0. If the extra has unlimited inventory this will return nil.

  • When accessed through an experience slot, it will return the remaining stock for the extra on the given slot.
  • When accessed independently or through a product, it will return the sum total of remaining stock for the extra across all upcoming slots.

extra.segment_name

string

If the extra belongs to a segment this will return the segment name.

extra.sold_out

boolean

Returns true if the extra is sold out.

  • When accessed through an experience slot, it will return true if the extra is sold out on the given slot.
  • When accessed independently or through a product, it will return true if the extra is sold out across all slots, i.e. all stock is sold or they have been manually marked as ‘Sold Out’. Any slot in the past is also considered sold out.

extra.tagline

string

The extra’s tagline.

extra.type

string

Will always return “extra”. This is useful when you have a list of Variant and Extra objects and you need to distinguish between them.