Last active
September 18, 2018 08:24
-
-
Save magevision/f89c6ec2c87a8552cd28623488266c5e to your computer and use it in GitHub Desktop.
HowToChangeCurrencySymbolPosition
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace MageVision\Blog30\Observer; | |
use Magento\Framework\Event\ObserverInterface; | |
use Magento\Framework\Event\Observer; | |
use Magento\Framework\Currency; | |
class CurrencySymbolChangePositionObserver implements ObserverInterface | |
{ | |
/** | |
* currency_symbol_change_position | |
* | |
* @param Observer $observer | |
* @return CurrencySymbolChangePositionObserver | |
*/ | |
public function execute(Observer $observer) | |
{ | |
$currencyOptions = $observer->getEvent()->getCurrencyOptions(); | |
$currencyOptions->setData('position', Currency::RIGHT); | |
return $this; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd"> | |
<event name="currency_display_options_forming"> | |
<observer name="currency_symbol_change_position" instance="MageVision\Blog30\Observer\CurrencySymbolChangePositionObserver" /> | |
</event> | |
</config> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment