Variant

Renders product and variant selectors, returning a Variant object.

Renders two select inputs from which a creator can first select a product and then choose a specific variant from that product.

Returns: A Variant object.

Properties

PropertyDescriptionRequired
only_fromRestricts the product types available for selection. Accepts an array of experiences and/or accommodations. If omitted, all product types are shown.No

Example

---
attributes:
  featured_variant:
    type: variant
    label: Featured variant
    default: random
    only_from:
      - experiences
---
{% if featured_variant %}
  <h3>{{ featured_variant.name }}</h3>
  <p>{{ featured_variant.price | money }}</p>
{% endif %}

Setting defaults

The default value accepts random, which selects a random variant from the creator's published products. Random defaults will respect any only_from restrictions.

On this page