How to change currency in fronted?
@Vaishali-Agarwal I was also looking for same but in 1.1 version there is no Currency dropdown.
I tried to setup a new currency INR with Code as 'Rs', and then modified 'default' "Channel" with default currency as INR and I get exception in 'Velocity Theme'.
But if I change theme to 'default', exception is no longer there but currency is still displayed in USD.
Trying to get property 'code' of non-object (View: /Users/agupta/PlayGround/bagisto/bagisto-bagisto-v1.1.2-0-gc88ca31/bagisto-bagisto-c88ca31/resources/themes/velocity/views/UI/header.blade.php) (View: /Users/agupta/PlayGround/bagisto/bagisto-bagisto-v1.1.2-0-gc88ca31/bagisto-bagisto-c88ca31/resources/themes/velocity/views/UI/header.blade.php) (View: /Users/agupta/PlayGround/bagisto/bagisto-bagisto-v1.1.2-0-gc88ca31/bagisto-bagisto-c88ca31/resources/themes/velocity/views/UI/header.blade.php) (View: /Users/agupta/PlayGround/bagisto/bagisto-bagisto-v1.1.2-0-gc88ca31/bagisto-bagisto-c88ca31/resources/themes/velocity/views/UI/header.blade.php)
currency option in channel : Channel->Currency should be all selected
@Vaishali-Agarwal thanks for the quick response. Not sure whether I fully comprehend your suggestion though. Here is what my setting is for Channel. Please suggest what different I should be doing.
Never mind I got it. For reference of other folks, here is how setting should be - Select all the currencies under 'Currencies'
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.
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
@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?
could you run php artisan config:cache
php artisan config:cache
Ran the command but no difference in Admin.
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
sudo service apache2 restart
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?
@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'
is this a bug in Bagisto?
no it's not an bug, may be u missed something
kindly check all the below solution:
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.