Menu Close
    Start a Project Request quote Reading list Switch to dark mode
    magento-hyperlocal-marketplace-guide

    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 :


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

    . . .

    Comments (6)

    Add Your Comment

  • Satish V
    Thank you! very useful
    • Prabhat Rawat
      Your’s Welcome
  • 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 awesome.save my lots of times.
    Thank you for sharing your knowledge.
    • Prabhat Rawat
      Thank you
      #Webkul
  • Back to Top
    css.php
    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
    Close