Bagisto Forum

    Bagisto

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups

    How to change currency in fronted?

    General Discussion
    3
    17
    2426
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • A
      AshJi last edited by

      @AshJi said in How to change currency in fronted?:

      Select all the currencies

      Hi @Vaishali-Agarwal I am facing a peculiar issue with currency in production. I have setup the currency to INR as suggestion above. But when I try to add new product or edit existing products, it still shows $ sign in 'Pricing" section.

      ed4c04f1-7846-4ed8-81c0-cd93010d1e71-image.png

      Screenshot 2020-07-31 at 4.30.39 PM.png

      Screenshot 2020-07-31 at 4.32.54 PM.png

      1 Reply Last reply Reply Quote 0
      • V
        Vaishali Agarwal last edited by

        @AshJi
        when we set the default currency from the channel then it's only used for the frontend, to change the admin end default currency, it's configuration change from the config/app.php file https://prnt.sc/trqov8

        1 Reply Last reply Reply Quote 0
        • A
          AshJi last edited by

          @Vaishali-Agarwal I made the changes in config/app.php and ran this command

          php artisan config:clear
          

          Now I can see ₹ symbol in Shop - Home, Product Detail, Cart etc but when I open 'Edit Product' or 'New Product' in Admin then it still shows $ symbol. Do I need to change somewhere else as well?

          Screenshot 2020-07-31 at 4.30.39 PM.png

          1 Reply Last reply Reply Quote 0
          • V
            Vaishali Agarwal last edited by

            @AshJi
            could you run php artisan config:cache

            1 Reply Last reply Reply Quote 0
            • A
              AshJi last edited by

              @Vaishali-Agarwal said in How to change currency in fronted?:

              php artisan config:cache

              Ran the command but no difference in Admin.

              a98897f6-d17c-4534-863c-eeb040eb0fe2-image.png

              1 Reply Last reply Reply Quote 0
              • A
                AshJi last edited by

                Should I have to restart the server to address the Currency issue? What will be the command to restart the server on Google CLoud server

                php artisan serve
                

                or

                sudo service apache2 restart
                

                Please confirm.

                1 Reply Last reply Reply Quote 0
                • V
                  Vaishali Agarwal last edited by

                  @AshJi

                  No need to restart the server configuration but still if you want to restart your server then run

                  sudo service apache2 restart
                  

                  can you go to .env file and add the APP_CURRENCY=INR then flush the cache or see if still having same issue?

                  1 Reply Last reply Reply Quote 0
                  • A
                    AshJi last edited by

                    @Vaishali-Agarwal in .env file variable 'APP_CURRENCY' had value 'USD'. I changed it to 'INR' and ran below commands

                    php artisan view:clear
                    php artisan cache:clear
                    composer dump-autoload
                    

                    Open Admin in incognito mode. But currency is still in USD. I noticed that while doing SQL query, it is still fetching details from currency table for 'USD' even though the env variable is 'INR'

                    Screenshot 2020-07-31 at 7.39.19 PM.png Screenshot 2020-07-31 at 7.39.39 PM.png

                    1 Reply Last reply Reply Quote 0
                    • A
                      AshJi last edited by

                      is this a bug in Bagisto?

                      1 Reply Last reply Reply Quote 0
                      • V
                        Vaishali Agarwal last edited by

                        @AshJi
                        no it's not an bug, may be u missed something
                        kindly check all the below solution:
                        https://forums.bagisto.com/topic/451/how-to-change-currency-and-locale-for-admin

                        https://forums.bagisto.com/topic/1129/update-the-base-currency-in-admin-panel/3

                        https://forums.bagisto.com/topic/50/how-can-i-change-the-base-currency-symbol-on-admin-dashboard

                        1 Reply Last reply Reply Quote 0
                        • A
                          AshJi last edited by

                          @Vaishali-Agarwal said in How to change currency in fronted?:

                          may be u missed something

                          This isn't much helpful 😞

                          Anyway I investigated found the issue. It seems that Bagisto is fetching currency details picking code from both from cache and "currency" variable. I noticed that following 2 SQLs were executed on each page

                          select * from `currencies` where `code` = 'INR'
                          select * from `currencies` where `code` = 'USD'
                          

                          In /bootstrap/cache/config.php APP_CURRENCY was set to 'USD'. I changed it to 'INR' and fixed the problem. I will lated delete the cache and try.

                          1 Reply Last reply Reply Quote 0
                          • First post
                            Last post