Menu Close
    Hire us Request quote Reading list Switch to dark mode

    Programmatically change/set the current currency of store in Magento 2.

    In this Article I am going to explain, how to change the current currency of the store.
    Need : If you are developing Api’s or creating the custom module, the situation may come, when you need to change the current currency of store.
    To get the right behaviour for the target.

    Here we go :

    . . .
    Subscribe Articles

    Just enter your email below to subscribe and receive weekly updates about the most interesting similar articles.

    You need to accept conditions to receive letters.
    You've Subscribed!

    Share article via

    . . .

    $currency is a currency code in which you want to set the current currency to your store.

    . . .

    Comments (4)

    Add Your Comment

  • Patrick van Bergen
    Yes, very useful!

    I placed this code in a handler for the event ‘controller_action_predispatch’ to force the full request to this currency. Worked like charm!

    • Prabhat Rawat
      Your’s most welcome
  • Rajesh Gohil
    Wow..Working Great!!
    Webkul guys are always my lots of times.
    Thank you for sharing your knowledge.
    • Prabhat Rawat
      Thank you
  • Back to Top
    Hire Us!
    Brief us about your requirements and we'll get back to you.
    Woo! Hooy!
    We have just recieved your project brief and our expert will contact you shortly.
    Send Again