chec / commercejs-nextjs-demo-store

Commerce demo store built for the Jamstack. Built with Commerce.js, Next.js, and can be one-click deployed to Netlify. Includes product catalog, customer login, categories, variants, cart, checkout, payments (Stripe) order confirmation, and printable receipts.
https://commercejs-demo-store.netlify.app/
BSD 3-Clause "New" or "Revised" License
1.07k stars 206 forks source link

"Add to cart" currency symbol #180

Closed zb2oby closed 3 years ago

zb2oby commented 3 years ago

Hi,

The" add to cart" button is rendered with an hard-codded currency symbol :

${this.getPrice()}

it should be :

{`this.getCurrencySymbol(product.price.formatted_with_symbol)}{this.getPrice()}

maybe add it in utils :

getCurrencySymbol(priceFormattedWithSymbol) { return priceFormattedWithSymbol.substring(1, 0); }

robbieaverill commented 3 years ago

Thank you @zb2oby