Upsell Variables

This page defines all properties available for an upsell.

Variable Usage
upsell.id Returns the id for an upsell.
{% for upsell in product.upsells %}
    {{ upsell.id }}
{% endfor %}
upsell.base_price Returns the base price for an upsell (before discounts applied, if applicable).
{% for upsell in product.upsells %}
    {{ upsell.base_price }}
{% endfor %}
upsell.price Returns the total price for an upsell.
{% for upsell in product.upsells %}
    {{ upsell.price }}
{% endfor %}
upsell.name Returns the name of the upsell.
{% for upsell in product.upsells %}
    {{ upsell.name }}
{% endfor %}
upsell.url_name Returns the URL name of the upsell. Example shows full path to upsell product.
{% for upsell in product.upsells %}
    {{ site_url('/product') }}/{{ upsell.url_name }}
{% endfor %}
upsell.sku Returns the sku for the upsell.
{% for upsell in product.upsells %}
    {{ upsell.sku }}
{% endfor %}
upsell.parentProduct Returns the parent product of the upsell.
{% for upsell in product.upsells %}
    {% set parent = upsell.parentProduct %}
{% endfor %}
upsell.product Returns the upsell product.
{% for upsell in product.upsells %}
    {% set product = upsell.product %}
{% endfor %}
upsell.variant Returns the upsell variant.
{% for upsell in product.upsells %}
    {% set variant = upsell.variant %}
{% endfor %}
upsell.limitQuantityToOne() Method - returns true if an upsell can only have a quantity of 1 in a cart.
{% for upsell in product.upsells %}
    {% if upsell.limitQuantityToOne() %}
        {# Do #}
    {% endif %}
{% endfor %}