price_product_special¶
The price_product_special
macro is used to render a single special price on a product card. Internally it's just a price_special macro with additional styling.
Definition¶
Input parameters¶
price¶
string
represents a price to render.
label¶
string
if set, an additional price label will be displayed.
Example¶
In this example we render a price with a label.
{% from "@macros/price_product_special.twig" import price_product_special %}
{{ price_product_special('$12.34', 'Price:') }}
Macro source code¶
{% macro price_product_special(price, label = '') %}
{% from "@macros/price_special.twig" import price_special %}
{{
price_special(price, label, {
price: 'price_l',
priceValue: 'price__value_bold js__special-offer-price-value',
iconSize: 'icon_l'
})
}}
{% endmacro %}