arbuzas Posted January 17, 2017 Share Posted January 17, 2017 It looks like in version 1.7 invoices display Euro as 'EUR' instead of '€' symbol. I can't seem to find any way to change this, any ideas? Link to comment Share on other sites More sharing options...
bellini13 Posted January 18, 2017 Share Posted January 18, 2017 Yup, stop using v1.7 and use v1.6 instead, your problem will be solved, as will alot of other problems you do not know you have yet 2 Link to comment Share on other sites More sharing options...
arbuzas Posted January 18, 2017 Author Share Posted January 18, 2017 1.6 will be discontinued in a year or so, I don't see a point wasting time with it, will have to migrate to 1.7 anyway. 1 Link to comment Share on other sites More sharing options...
bellini13 Posted January 18, 2017 Share Posted January 18, 2017 believe what you like, clearly i have no clue 1 Link to comment Share on other sites More sharing options...
Vilius PromoApranga Posted January 21, 2017 Share Posted January 21, 2017 It shows € in english, but in my language it shows EUR.. Link to comment Share on other sites More sharing options...
arbuzas Posted January 24, 2017 Author Share Posted January 24, 2017 Ok so it looks like PrestaShop 1.7 is using new fancy pancy Cldr framework (ICanBoogie). Basically it drags all localisation stuff from the Cldr database (repo). It's all good but unfortunately this framework does not give many option for customisation (not that I found any) so you have to be happy what Cldr provides. In my case Cldr dictates that currency sign is "EUR" on the left, when we actually more used to "€" on the left. Anyway, it is possible to override this by creating file in: override/classes/Tools.php <?php /** * Forcing to use Euro (Currency) sign */ class Tools extends ToolsCore { public static function displayPrice($price, $currency = null, $no_utf8 = false, Context $context = null) { if (!is_numeric($price)) { return $price; } if (!$context) { $context = Context::getContext(); } if ($currency === null) { $currency = $context->currency; } elseif (is_int($currency)) { $currency = Currency::getCurrencyInstance((int)$currency); } $numberFormatter = new ICanBoogie\CLDR\NumberFormatter; return $numberFormatter->format($price, "#0.#0").' '.$currency->getSign(); } } ?> This workaround is bit crusty but meh.. it works. Link to comment Share on other sites More sharing options...
bellini13 Posted January 24, 2017 Share Posted January 24, 2017 Wait until you realize that it also does not support zero decimal currencies anymore. 1 Link to comment Share on other sites More sharing options...
arbuzas Posted January 24, 2017 Author Share Posted January 24, 2017 Wait until you realize that it also does not support zero decimal currencies anymore. I don't care, irrelevant for European business.. If its true I'm sure they will come up with something. Link to comment Share on other sites More sharing options...
bellini13 Posted January 24, 2017 Share Posted January 24, 2017 There are a few countries in and near Europe that do not use decimals, so while you may not care, there are plenty that do. If its true I'm sure they will come up with something. The problem is that Prestashop appears to think like you. Let's remove features that we think are not important, and now we have to re-add them back because we didn't have enough foresight to see what issues it might create. In a nutshell, that is the problem with PS v1.7 Link to comment Share on other sites More sharing options...
arbuzas Posted January 24, 2017 Author Share Posted January 24, 2017 Offtopic... The problem is that Prestashop appears to think like you. Nah.. I'm still just playing with 1.7, and I'm not sure if I like it or if I'll use it. It looks like it was patched with bits and bobs from the 1.6v and everything is all over the place. In my opinion they just had to start from scratch if they wanted to change everything... pretty much everything broke anyway. 1.6 is also rusty.. so yeah not sure, I might look somewhere else if I can't make 1.7 to work. Link to comment Share on other sites More sharing options...
Vilius PromoApranga Posted January 24, 2017 Share Posted January 24, 2017 Ok so it looks like PrestaShop 1.7 is using new fancy pancy Cldr framework (ICanBoogie). Basically it drags all localisation stuff from the Cldr database (repo). It's all good but unfortunately this framework does not give many option for customisation (not that I found any) so you have to be happy what Cldr provides. In my case Cldr dictates that currency sign is "EUR" on the left, when we actually more used to "€" on the left. Anyway, it is possible to override this by creating file in: override/classes/Tools.php <?php /** * Forcing to use Euro (Currency) sign */ class Tools extends ToolsCore { public static function displayPrice($price, $currency = null, $no_utf8 = false, Context $context = null) { if (!is_numeric($price)) { return $price; } if (!$context) { $context = Context::getContext(); } if ($currency === null) { $currency = $context->currency; } elseif (is_int($currency)) { $currency = Currency::getCurrencyInstance((int)$currency); } $numberFormatter = new ICanBoogie\CLDR\NumberFormatter; return $numberFormatter->format($price, "#0.#0").' '.$currency->getSign(); } } ?> This workaround is bit crusty but meh.. it works. But it works only in product page, not ir modules or "hopepage" Link to comment Share on other sites More sharing options...
arbuzas Posted January 24, 2017 Author Share Posted January 24, 2017 Right.. I see what you mean. Well it looks like you can't override symfony based pages. I guess you can edit Tools.php directly and live till next update that way... I saw somewhere mentioned that instead of overriding the code you can extend it or something like that.. but can't find any documentation about it so not sure whats the story with that. 1 Link to comment Share on other sites More sharing options...
mysho Posted February 9, 2017 Share Posted February 9, 2017 Try to edit these files: EUR to €: in this file web/translations/cldr/main--xx-XX--currencies , change "symbol":"EUR" to "symbol":"€" Removing decimals: in this file web/translations/cldr/main--xx-XX--numbers , change "standard":"#,##0.00\u00a0\u00a4" to "standard":"#,##0\u00a0\u00a4" xx-XX is language which you use 2 Link to comment Share on other sites More sharing options...
mikias Posted May 25, 2017 Share Posted May 25, 2017 Try to edit these files: EUR to €: in this file web/translations/cldr/main--xx-XX--currencies , change "symbol":"EUR" to "symbol":"€" Removing decimals: in this file web/translations/cldr/main--xx-XX--numbers , change "standard":"#,##0.00\u00a0\u00a4" to "standard":"#,##0\u00a0\u00a4" xx-XX is language which you use in this case removing decimal also remove args after decimal. How to fix that? Link to comment Share on other sites More sharing options...
joseantgv Posted January 15, 2019 Share Posted January 15, 2019 If you don't want to mess with files, there's a module in Addons which lets you configure the currencies as in PS 1.6: https://addons.prestashop.com/en/price-management/27821-change-or-remove-the-decimals-and-format-currency.html 1 Link to comment Share on other sites More sharing options...
david45 Posted September 5, 2019 Share Posted September 5, 2019 I currently using the Prestashop Version 1.7.5.1 and tried your solution and changed the currency sign form "\u20ac" to "EUR" but now no currency sign appears even if i try to undo it. Is there a way to fix this issue? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now