E-commerce

Currency Switcher

A Beirut online supermarket priced in US dollars with a USD / LBP / EUR switch. Every price, the mini basket and the checkout roll over to the chosen currency, while the store always charges in USD. Merchants set exchange rates, LBP rounding (to the nearest 1,000 or 5,000), display formats and EUR price endings, and every order gets a receipt in both currencies.

Use the Live / Loading / Empty / Error switch at the top to see every state.

Why it matters

Shoppers can think in the currency they use every day without the store taking on exchange risk: prices are set once in USD, local estimates stay honest and readable, and a rate change mid-session is explained instead of silently changing the total.

How it works

  1. 01Prices live in USD. The switch converts each item at the store’s rate, rounds it per item (none, 1,000, 5,000 or 10,000 LBP, nearest or always up) and formats it the way the merchant chose — including 2,095,000 LBP, LBP 2,095,000 or the Arabic ل.ل — with the USD base price underneath.
  2. 02The basket and checkout show the estimate in the chosen currency, a rounding line, and “Charged in USD”. If the rate moves while someone shops or checks out, a notice shows the old and new estimate, and the order waits until the new rate is accepted.
  3. 03Placing an order locks the rate. The receipt (card or 80 mm thermal) lists every line in USD and LBP or EUR, the exact equivalent and the cash due for LBP cash on delivery. Very large LBP totals scale to fit on phones, and long prices on narrow product cards shorten to 16.9M LBP.

See it inside a full build