A currency symbol is basically a graphical notation that represents particular currency instead of writing the whole name beside price. For business, it’s extremely important to specified But the potion of this graphical notation varies by currency.
Take a look at following example:
Many currencies in the English-speaking world and Latin America place it before the amount like this $10.00 but n many European countries such as France, Germany, Greece, Scandinavian countries, the symbol is usually placed after the amount like this 10.00€.
Also, the decimal separator follows countries and currency standards.
But Magento fails to change position when you change the Currency from the backend. That’s why one of our client and friend asked us to do same. To help more people and to fix this issue quickly, we decided to published an article on our blog.
Create another ‘events.xml’ file inside your folder.
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
<observer name="vendor_extension_change_currency_position" instance="Vendor\Extension\Model\Observer\Changecurrencyposition" />
Now you need to create another observer file inside extension folder.
class Changecurrencyposition implements ObserverInterface
public function execute(\Magento\Framework\Event\Observer $observer)
$currencyOptions = $observer->getEvent()->getCurrencyOptions();
Lastly, Run the following command and you are done.
php bin/magento setup:upgrade
Yes, you have successfully changed the position of currency symbol in store frontend. Comment down below if you face any issue while using this code.