OFFLINE-GmbH / oc-snipcartshop-plugin

Ecommerce solution for October CMS using snipcart.com as a backend
MIT License
11 stars 4 forks source link

How to customize the formatted price ? #20

Closed ghost closed 5 years ago

ghost commented 7 years ago

Hello,

I noticed that, when you want to display the formatted price, there is a {{ product.priceFormatted }} twig variable.

However, it display price like that (example with euros) :

EUR 10.00

How to display price like that :

10,00€

In addition, it would be great to display if the price is including or excluding taxes, for example :

10,00€ (Inc. VAT) or 10,00€ (Exc. VAT)

Thank you for your help

Alex

tobias-kuendig commented 7 years ago

This is currently not possible. At the moment you can simply use the price property and format it yourself (maybe with a custom twig filter).

I haven't come across a simple solution for this problem yet. The format will have to be specified on a per currency basis. Maybe I'll add a format field to the currency repeater where this format can be customized.

ghost commented 7 years ago

Yes, I think the best way to do that is to let user defined it's own code to format the price for each currency with some token available.

I think about something like that

tobias-kuendig commented 7 years ago

I have implemented this feature based on your ideas in version 1.0.33. It's available via edge updates. Feel free to test it!

ghost commented 7 years ago

You are the best ! I will test that

tobias-kuendig commented 5 years ago

Closed due to inactivity.