djangopython-3.xlocalizationcurrencydjango-oscar

How do I change currency symbol on django-oscar dashboard?


As the title explains, I want to change the default currency on Django-oscar dashboard. It's showing it as £ and I need R which is South Africa. I have changed my settings.py to South African timezone(johannesburg) and I have added the i18n path. I read that the frontend will check the users local language to set the currency but I know my browser is all set to South African locale.

in settings.py I have also added the following which I could be doing wrong:

OSCAR_CURRENCY_LOCALE = 'ZAR'

OSCAR_CURRENCY_FORMAT = {
    'ZAR': {
        'format': u'R #,##',
    }
}

I'm not sure if this is the correct way to do it or not but the frontend still shows me £ every time.

Django-oscar 2.0.4, Python 3.7.4, Django 2.2.12


Solution

  • I read that the frontend will check the users local language to set the currency.

    No, it won't do that. Currency is completely separate from language, and has to be set explicitly by you in code. If you are operating a site only in ZAR you just need to set OSCAR_DEFAULT_CURRENCY:

    OSCAR_DEFAULT_CURRENCY = 'ZAR'
    

    Which will then be used with the custom format you've specified. You will also need to make sure that your stock record prices are using ZAR.