A price has an amount and a currency. The shopper's language decides how it is written: digits, separators, grouping and where the symbol goes. Changing the language never converts the currency.
The same price in different languages#
Language |
USD 1234567.89 |
USD 0.00 |
USD -1234567.89 |
|---|---|---|---|
|
$1,234,567.89 |
$0.00 |
-$1,234,567.89 |
|
$12,34,567.89 |
$0.00 |
-$12,34,567.89 |
|
1 234 567,89 $ |
0,00 $ |
-1 234 567,89 $ |
|
1.234.567,89 $ |
0,00 $ |
-1.234.567,89 $ |
|
$ 1'234'567.89 |
$ 0.00 |
$-1'234'567.89 |
|
1,234,567.89 US$ |
0.00 US$ |
-1,234,567.89 US$ |
|
1,234,567.89 $ |
0.00 $ |
-1,234,567.89 $ |
|
$۱٬۲۳۴٬۵۶۷٫۸۹ |
$۰٫۰۰ |
−$۱٬۲۳۴٬۵۶۷٫۸۹ |
|
$12,34,567.89 |
$0.00 |
-$12,34,567.89 |
|
১২,৩৪,৫৬৭.৮৯$ |
০.০০$ |
-১২,৩৪,৫৬৭.৮৯$ |
|
$1,234,567.89 |
$0.00 |
-$1,234,567.89 |
Every supported language is in the language reference.
Decimal places#
Each currency has its own number of decimal places: two for USD and EUR, none for JPY, three for KWD. Some currencies display fewer than they store; IDR stores two and displays whole rupiah.
Currency |
Accepted amount |
Displayed in English |
|---|---|---|
USD |
|
$1,234.56 |
JPY |
|
¥1,234 |
KWD |
|
KWD 1,234.567 |
IDR |
|
Rp 1,235 |
Every currency is in the currency reference.
{{ product.price.current | money }} {# $1,850.00 #}
{{ product.price.current | money: trim_zeros: true }} {# $1,850 #}
A price always shows its currency's decimal places. Add trim_zeros: true to leave them out when the amount is whole. This changes only how the price is written, never the amount charged.
Prices in a theme#
{{ product.price.current | money }}
{% if product.price_range.has_range %}
{{ product.price_range.min | money: isolate: true }} – {{ product.price_range.max | money: isolate: true }}
{% else %}
{{ product.price.current | money: isolate: true }}
{% endif %}
money takes a price value, such as product.price.current, and formats it in the shopper's language. A plain number, a missing currency or more decimal places than the currency allows is an error. What a theme may and may not do with money is rule money.formatted of the theme contract.
Price notes#
The notes under a product price and a cart total come finished from the platform: product.price_notes on the product page and cart.price_notes in the rich cart, each with tax and duty. tax says what the price means for tax (included, estimated, excluded and added at checkout, or calculated at checkout), and duty who pays import duties when an item is imported into the shopper's country (on delivery, at checkout, or included; at checkout only where the destination has an enabled duty rule). They follow the market's setup for the shopper's country, are in the shopper's language, and merchants word them in Storefront Messages. Each is null where it does not apply.
{% assign n = product.price_notes %}
{% if n.tax or n.duty %}<p class="price-note">{{ n.tax }} {{ n.duty }}</p>{% endif %}
{% assign n = cart.price_notes %}
{% if n.tax or n.duty %}<p class="cart-note">{{ n.tax }} {{ n.duty }}</p>{% endif %}
Print them as given and do not write your own tax or duty notes from tax_display: the platform's notes already account for markets with no tax, estimated tax and import duties (theme contract rule money.note). Product and cart templates must print them.
Order duties#
Import duties on a past order are part of its total only when they were collected at checkout. Then customer.order.pricing.duty.has_amount is true and pricing.duty.total is a totals row. Duties payable on delivery, or included in the prices, are never a charge on the order: pricing.duty.note says who pays them, finished and in the shopper's language, with the estimate when there is one, as checkout and the order status page say it. It is empty for an order with no import duties.
{% assign pr = customer.order.pricing %}
{% if pr.duty.has_amount %}
<div><dt>{{ 'account.duties' | t }}</dt><dd>{{ pr.duty.total | money }}</dd></div>
{% endif %}
<div><dt>{{ 'cart.total' | t }}</dt><dd>{{ pr.grand_total | money }}</dd></div>
</dl>
{% if pr.duty.note != blank %}<p class="duty-note">{{ pr.duty.note }}</p>{% endif %}
Print the note below the total, never as a totals row, and never list a duty payable on delivery among the charges (theme contract rule money.order_duty).
Right-to-left languages#
Storefront pages set dir="rtl" on the html element for right-to-left languages. Use CSS logical properties such as margin-inline-start so the layout works in both directions, and keep the formatted price as it is.
When a price sits inside translated text or next to punctuation, use money: isolate: true. It keeps the whole price together when left-to-right and right-to-left text mix.
Check negative prices, currency codes and line wrapping in both directions.
The shopper's language#
localization.locale is the active language, and localization.available_languages lists the store's languages with their code, name and rtl flag. Choosing a country can also change the currency. See Locale, country, and currency.
Translate labels such as "Subtotal" with the t filter and your theme locale files.