Difficulties with Locale

Hello everybody!

I’ve been studying moqui for two months now;

I’m facing some problems with locale settings. As I am in Brazil, I would like things to work in pt_BR and America/São_Paulo, however, when I configure the file ~/moqui/framework/src/main/resources/MoquiDefaultConf.xml

Code snippet;

    <default-property name="default_locale" value="pt_BR"/>
    <default-property name="default_time_zone" value="America/Sao_Paulo"/>
    <default-property name="database_time_zone" value="America/Sao_Paulo"/>
  1. The screen http://moqui.local:8080/qapps/hmadmin/dashboard,

Does not load the screen when used with the configuration dynamic Material UI.

But it loads with the configuration standard UI and dynamic Bootstrap UI.

If the settings in default_locale are set again to en_US, the screen works again in all UIs…

  1. Another thing that is puzzling me is the fact that the prices of the products in the ecommerce only appear if they have a field definition priceUomId**=“USD”, if you have another currency, for example** priceUomId**=“BRL” , prices do not load.**

File;

~/moqui/runtime/component/PopRestStore/data/PopRestStoreProductData.xml

    <mantle.product.Product productId="DEMO_TS_M" productTypeEnumId="PtVirtual" assetTypeEnumId="" assetClassEnumId=""
            chargeShipping="Y" returnable="Y" productName="Men&apos;s T-Shirt" description="">
        <!-- list price -->
        <prices productPriceId="DEMO_TS_M_L" pricePurposeEnumId="PppPurchase" priceTypeEnumId="PptList" fromDate="1265184000000"
                minQuantity="1" price="19,99" priceUomId="USD"/>
        <!-- long-term current price -->
        <prices productPriceId="DEMO_TS_M_CLT" pricePurposeEnumId="PppPurchase" priceTypeEnumId="PptCurrent" fromDate="1265184000000"
                minQuantity="1" price="18,99" priceUomId="BRL"/>

With the file PopRestStoreProductData.xml configured as shown above… the product “DEMO_TS_M_L" only the price will appear 19,99 that is defined priceUomId="USD", already the product “DEMO_TS_M_CLT” with the configuration price="18,99" priceUomId="BRL" does not display the value.

Note: All Location settings are set to pt_BR and America/Sao_Paulo.

If anyone can help me…
I’ll be thankful

Hey guys!

I hope everyone is okay.
To save you from wasting time, I’m stopping by to let you know that I found a solution for ITEM 2 on my list.
I made some changes to the CarrierServices.xml and PriceServices.xml files;

In…

<parameter name="priceUomId" default="ec.user.getPreference('CurrencyDefault') ?: 'USD'"/>

To…

<parameter name="priceUomId" default="ec.user.getPreference('CurrencyDefault') ?: 'BRL'"/>

I don’t know if it’s the best practice, but it solved the problem.

Thank you all.

I guess it is better to send the parameter priceUomId explicitly instead of changing the default as this may leads to that the examples not working. In case you need to get knowing how system work, you will need a working example to explore.

1 Like

Thank you Strand…
I don’t know how to do otherwise. If it’s not too much work and you can post here how to proceed. I will be grateful.

If changing that worked chances are you don’t have a CurrencyDefault preference set, and this can be set for all users by adding it to the ALL_USERS UserGroup (in the System app under User Groups).

2 Likes

I made the suggested changes.
Worked perfectly.
“Moqui” is fantastic!
Thanks jonesde!!