karliuka / m2.Price

Magento2. Rounding Price to Prettier Value for Multi-Currency Stores.
Open Software License 3.0
65 stars 16 forks source link

Prevent rounding in the Admin system? #17

Closed swaibar closed 3 years ago

swaibar commented 4 years ago

I thought the intention of the of this was to update the frontend only? When using this module it affects the admin and any other area. I'm looking at the best way to add a pull request, but at present my fix is to change...

if ($this->isRoundEnabled($subject, $toCurrency)) {

to...

if ($this->isRoundEnabled($subject, $toCurrency)
            && \Magento\Framework\App\ObjectManager::getInstance()
                ->get('Magento\Framework\App\State')->getAreaCode() == 'frontend'
        ) {

in aroundConvertin Faonni\Price\Plugin\Directory\Model\Currency