price_unit¶
The price_unit
macro is used to render a unit price of the product.
Definition¶
Input parameters¶
price¶
string
A unit price of the product
label¶
string
if specified, an additional label will be rendered next to the unit price
Example¶
A base usage of the macro.
Example¶
Unit price with an additional label.
Macro source code¶
{% macro price_unit(price, label) %}
{% from "@macros/price_base.twig" import price_base %}
{{
price_base(price, label, {
price: 'price_xs',
priceValue: 'price__value_secondary js__unit-price'
})
}}
{% endmacro %}