Magento 2 : Currency change frontend eventChange Magento base and display currency (and auto-update the prices in backend, EUR -> RON)Product price suddenly reduces when adding product to quote via admin backend, if Magento contains multiple currenciesCurrency Symbol doesnt changeHow to change currency symbol OR add own currencyHow to get current currency symbol in multi-currencies magento 2magento 1.9 Create order programmatically in aed currency with aed rateMagento change quote currency programmaticallyMagento-2 How to convert price from current currency to base currencyMagento 2 - Product custom price not change based with current currencyMultiple currency not working with custom price quote - Magento 2

Does the 500 feet falling cap apply per fall, or per turn?

LocalDate.plus Incorrect Answer

Exception propagation: When to catch exceptions?

Is it a bad idea to replace pull-up resistors with hard pull-ups?

Is Simic Ascendancy triggered by Awakening of Vitu-Ghazi?

Can the sorting of a list be verified without comparing neighbors?

Control variables and other independent variables

What food production methods would allow a metropolis like New York to become self sufficient

Is there a faster way to calculate Abs[z]^2 numerically?

Increase height of laser cut design file for enclosure

Was there a contingency plan in place if Little Boy failed to detonate?

"Right on the tip of my tongue" meaning?

How are one-time password generators like Google Authenticator different from having two passwords?

Why use steam instead of just hot air?

What does i386 mean on macOS Mojave?

Can 'sudo apt-get remove [write]' destroy my Ubuntu?

What are the ramifications of setting ARITHABORT ON for all connections in SQL Server?

Was there ever any real use for a 6800-based Apple I?

Washer drain pipe overflow

Remove everything except csv file Bash Script

Is the schwa sound consistent?

Does Lawful Interception of 4G / the proposed 5G provide a back door for hackers as well?

Was this a power play by Daenerys?

Is it a Munchausen Number?



Magento 2 : Currency change frontend event


Change Magento base and display currency (and auto-update the prices in backend, EUR -> RON)Product price suddenly reduces when adding product to quote via admin backend, if Magento contains multiple currenciesCurrency Symbol doesnt changeHow to change currency symbol OR add own currencyHow to get current currency symbol in multi-currencies magento 2magento 1.9 Create order programmatically in aed currency with aed rateMagento change quote currency programmaticallyMagento-2 How to convert price from current currency to base currencyMagento 2 - Product custom price not change based with current currencyMultiple currency not working with custom price quote - Magento 2






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















I want to update the quote item price on switching the currency from the frontend.



Is there any event to track currency switch option and give me the previous currency and requested currency?










share|improve this question
























  • create custom event reference: mageplaza.com/magento-2-module-development/…

    – Nikunj Vadariya
    Jun 23 '17 at 6:42

















0















I want to update the quote item price on switching the currency from the frontend.



Is there any event to track currency switch option and give me the previous currency and requested currency?










share|improve this question
























  • create custom event reference: mageplaza.com/magento-2-module-development/…

    – Nikunj Vadariya
    Jun 23 '17 at 6:42













0












0








0








I want to update the quote item price on switching the currency from the frontend.



Is there any event to track currency switch option and give me the previous currency and requested currency?










share|improve this question
















I want to update the quote item price on switching the currency from the frontend.



Is there any event to track currency switch option and give me the previous currency and requested currency?







magento2 frontend currency multicurrency






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jun 23 '17 at 6:22









Nikunj Vadariya

2,9261823




2,9261823










asked Jun 23 '17 at 6:21









Ashish JagnaniAshish Jagnani

4,64721957




4,64721957












  • create custom event reference: mageplaza.com/magento-2-module-development/…

    – Nikunj Vadariya
    Jun 23 '17 at 6:42

















  • create custom event reference: mageplaza.com/magento-2-module-development/…

    – Nikunj Vadariya
    Jun 23 '17 at 6:42
















create custom event reference: mageplaza.com/magento-2-module-development/…

– Nikunj Vadariya
Jun 23 '17 at 6:42





create custom event reference: mageplaza.com/magento-2-module-development/…

– Nikunj Vadariya
Jun 23 '17 at 6:42










1 Answer
1






active

oldest

votes


















1














I would recommend to write a Plugin on the following Controller Action :



MagentoDirectoryControllerCurrencySwitchAction



For example:



 <?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<type name="MagentoDirectoryControllerCurrencySwitch">
<plugin name="yournamespace_yourmodule_directory_currency_switch_plugin"
type="YourNamespaceYourModulePluginMagentoDirecotryControllerCurrencySwitchAction"
sortOrder="10"
disabled="false"/>
</type>
</config>


And then you could use the following code:



 <?php


namespace YourNamespaceYourModulePluginMagentoDirectoryControllerCurrency;

class Switch


protected $storeManager;

public function __construct(
MagentoStoreModelStoreManagerInterface $storeManager
)
$this->storeManager= $storeManager;


public function beforeExecute(
MagentoDirectoryControllerCurrencySwitchAction $subject,
$result
)
$currentCurrency = $this->storeManager->getStore()->getCurrentCurrencyCode();
$newCurrency = (string)$this->getRequest()->getParam('currency');
// your code here








share|improve this answer

























  • I will check your answer and let you know.

    – Ashish Jagnani
    Jun 23 '17 at 9:36











  • @AshishJagnani did you resolved the issue?

    – Mr. Lewis
    Jun 27 '17 at 20:36











Your Answer








StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "479"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f180423%2fmagento-2-currency-change-frontend-event%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









1














I would recommend to write a Plugin on the following Controller Action :



MagentoDirectoryControllerCurrencySwitchAction



For example:



 <?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<type name="MagentoDirectoryControllerCurrencySwitch">
<plugin name="yournamespace_yourmodule_directory_currency_switch_plugin"
type="YourNamespaceYourModulePluginMagentoDirecotryControllerCurrencySwitchAction"
sortOrder="10"
disabled="false"/>
</type>
</config>


And then you could use the following code:



 <?php


namespace YourNamespaceYourModulePluginMagentoDirectoryControllerCurrency;

class Switch


protected $storeManager;

public function __construct(
MagentoStoreModelStoreManagerInterface $storeManager
)
$this->storeManager= $storeManager;


public function beforeExecute(
MagentoDirectoryControllerCurrencySwitchAction $subject,
$result
)
$currentCurrency = $this->storeManager->getStore()->getCurrentCurrencyCode();
$newCurrency = (string)$this->getRequest()->getParam('currency');
// your code here








share|improve this answer

























  • I will check your answer and let you know.

    – Ashish Jagnani
    Jun 23 '17 at 9:36











  • @AshishJagnani did you resolved the issue?

    – Mr. Lewis
    Jun 27 '17 at 20:36















1














I would recommend to write a Plugin on the following Controller Action :



MagentoDirectoryControllerCurrencySwitchAction



For example:



 <?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<type name="MagentoDirectoryControllerCurrencySwitch">
<plugin name="yournamespace_yourmodule_directory_currency_switch_plugin"
type="YourNamespaceYourModulePluginMagentoDirecotryControllerCurrencySwitchAction"
sortOrder="10"
disabled="false"/>
</type>
</config>


And then you could use the following code:



 <?php


namespace YourNamespaceYourModulePluginMagentoDirectoryControllerCurrency;

class Switch


protected $storeManager;

public function __construct(
MagentoStoreModelStoreManagerInterface $storeManager
)
$this->storeManager= $storeManager;


public function beforeExecute(
MagentoDirectoryControllerCurrencySwitchAction $subject,
$result
)
$currentCurrency = $this->storeManager->getStore()->getCurrentCurrencyCode();
$newCurrency = (string)$this->getRequest()->getParam('currency');
// your code here








share|improve this answer

























  • I will check your answer and let you know.

    – Ashish Jagnani
    Jun 23 '17 at 9:36











  • @AshishJagnani did you resolved the issue?

    – Mr. Lewis
    Jun 27 '17 at 20:36













1












1








1







I would recommend to write a Plugin on the following Controller Action :



MagentoDirectoryControllerCurrencySwitchAction



For example:



 <?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<type name="MagentoDirectoryControllerCurrencySwitch">
<plugin name="yournamespace_yourmodule_directory_currency_switch_plugin"
type="YourNamespaceYourModulePluginMagentoDirecotryControllerCurrencySwitchAction"
sortOrder="10"
disabled="false"/>
</type>
</config>


And then you could use the following code:



 <?php


namespace YourNamespaceYourModulePluginMagentoDirectoryControllerCurrency;

class Switch


protected $storeManager;

public function __construct(
MagentoStoreModelStoreManagerInterface $storeManager
)
$this->storeManager= $storeManager;


public function beforeExecute(
MagentoDirectoryControllerCurrencySwitchAction $subject,
$result
)
$currentCurrency = $this->storeManager->getStore()->getCurrentCurrencyCode();
$newCurrency = (string)$this->getRequest()->getParam('currency');
// your code here








share|improve this answer















I would recommend to write a Plugin on the following Controller Action :



MagentoDirectoryControllerCurrencySwitchAction



For example:



 <?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<type name="MagentoDirectoryControllerCurrencySwitch">
<plugin name="yournamespace_yourmodule_directory_currency_switch_plugin"
type="YourNamespaceYourModulePluginMagentoDirecotryControllerCurrencySwitchAction"
sortOrder="10"
disabled="false"/>
</type>
</config>


And then you could use the following code:



 <?php


namespace YourNamespaceYourModulePluginMagentoDirectoryControllerCurrency;

class Switch


protected $storeManager;

public function __construct(
MagentoStoreModelStoreManagerInterface $storeManager
)
$this->storeManager= $storeManager;


public function beforeExecute(
MagentoDirectoryControllerCurrencySwitchAction $subject,
$result
)
$currentCurrency = $this->storeManager->getStore()->getCurrentCurrencyCode();
$newCurrency = (string)$this->getRequest()->getParam('currency');
// your code here









share|improve this answer














share|improve this answer



share|improve this answer








edited May 7 at 13:27









Divyesh Rana

84




84










answered Jun 23 '17 at 8:40









Mr. LewisMr. Lewis

1,310711




1,310711












  • I will check your answer and let you know.

    – Ashish Jagnani
    Jun 23 '17 at 9:36











  • @AshishJagnani did you resolved the issue?

    – Mr. Lewis
    Jun 27 '17 at 20:36

















  • I will check your answer and let you know.

    – Ashish Jagnani
    Jun 23 '17 at 9:36











  • @AshishJagnani did you resolved the issue?

    – Mr. Lewis
    Jun 27 '17 at 20:36
















I will check your answer and let you know.

– Ashish Jagnani
Jun 23 '17 at 9:36





I will check your answer and let you know.

– Ashish Jagnani
Jun 23 '17 at 9:36













@AshishJagnani did you resolved the issue?

– Mr. Lewis
Jun 27 '17 at 20:36





@AshishJagnani did you resolved the issue?

– Mr. Lewis
Jun 27 '17 at 20:36

















draft saved

draft discarded
















































Thanks for contributing an answer to Magento Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f180423%2fmagento-2-currency-change-frontend-event%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Category:9 (number) SubcategoriesMedia in category "9 (number)"Navigation menuUpload mediaGND ID: 4485639-8Library of Congress authority ID: sh85091979ReasonatorScholiaStatistics

Circuit construction for execution of conditional statements using least significant bitHow are two different registers being used as “control”?How exactly is the stated composite state of the two registers being produced using the $R_zz$ controlled rotations?Efficiently performing controlled rotations in HHLWould this quantum algorithm implementation work?How to prepare a superposed states of odd integers from $1$ to $sqrtN$?Why is this implementation of the order finding algorithm not working?Circuit construction for Hamiltonian simulationHow can I invert the least significant bit of a certain term of a superposed state?Implementing an oracleImplementing a controlled sum operation

Magento 2 “No Payment Methods” in Admin New OrderHow to integrate Paypal Express Checkout with the Magento APIMagento 1.5 - Sales > Order > edit order and shipping methods disappearAuto Invoice Check/Money Order Payment methodAdd more simple payment methods?Shipping methods not showingWhat should I do to change payment methods if changing the configuration has no effects?1.9 - No Payment Methods showing upMy Payment Methods not Showing for downloadable/virtual product when checkout?Magento2 API to access internal payment methodHow to call an existing payment methods in the registration form?