price_base¶
The price_base macro is used to render a single price with an optional label on the page.
Definition¶
Input parameters¶
price¶
string represents a price to render.
label¶
string if set, an additional price label will be displayed.
classNames¶
object An object of additional class parameters that will be appended to specific elements:
| Option key | Type | Default | Required | Description | 
|---|---|---|---|---|
| classNames.price | string | "" | no | Classes that will be appended to the main base price element | 
| classNames.priceLabel | string | "" | no | Classes that will be appended to the label of the base price | 
| classNames.priceValue | string | "" | no | Classes that will be appended to the price value element of the base price | 
Example¶
In this example we render a price with a label.
Example¶
In this example we render a price with an additional class added to the price value element.
{% from "@macros/price_base.twig" import price_base %}
{{ price_base('$12.34', '', {
    priceValue: 'color_success-600'
}) }}