Display currency
The customer may see prices in another currency, such as euros on a rental that sells in ISK. The prices are shown only. The customer always pays in the rental's currency.
What the customer sees
A picker, <mellow-currency>, lists the currencies. A pick turns every shown price into that currency at the day's rate, rounded to whole units, such as €975. A note then says: "Prices in EUR are estimates. You pay in ISK." The Pay step shows the charge first, with the estimate beside it: "ISK 133,000 about €975". The Pay button and the processor's card form name the charge.
The pick stays in the tab, so it holds from the search on the home page to the booking page.
Mellow reads the European Central Bank's reference rates once a day. With no rates, every price shows in the rental's currency and the picker hides.
Which currencies
In Mellow, open Settings · Widget, the widget, and the Currencies card. The rental's currency, EUR, USD and GBP always show. Add currency adds others, at most 10. Press Save.
The currencies attribute sets the list on one site instead. The rental's currency always comes first.
| Attribute | Values | Meaning |
|---|---|---|
currencies | text | The codes to offer, space-separated, such as EUR USD NOK. The rental's currency always comes first. The widget's list in Mellow by default. |
value | text | The first pick while the customer has picked none, such as EUR. The rental's currency by default. |
Code
In the site's header
The root's default content holds a picker above the steps. You may also put one anywhere else on the page, such as in the site's header. Outside <mellow-booking> it reads the first <mellow-booking> or <mellow-search> on the page. On a page with neither, it draws nothing.
To put your own <select> in its place, put it inside the element. An empty one gets the options, and one with options keeps them:
Code
<mellow-currency-note> is the note alone. It is empty, and hidden, while the rental's currency shows. The summary's default content holds one.
The charge
<mellow-price charge> always shows the rental's currency, whatever the picker says. Use it where the page names what the card is charged.
The event mellow-currency tells the page about a pick, with { currency }. store.setCurrency("EUR") picks from code.