shopsys icon indicating copy to clipboard operation
shopsys copied to clipboard

admin: MoneyType usage and localization

Open vitek-rostislav opened this issue 6 years ago • 3 comments

What is happening

I see confusion in usage of MoneyType - by default, the currency option is set to false (according to https://docs.shopsys.com/en/8.1/model/how-to-work-with-money/#money-in-forms) and the currency symbol is then rendered using {symbolAfterInput: currencySymbolByDomainId(domainId)} setting for the given form widget in templates (eg. https://github.com/shopsys/shopsys/blob/master/packages/framework/src/Resources/views/Admin/Content/TransportAndPayment/freeTransportAndPaymentLimitSetting.html.twig#L47 or https://github.com/shopsys/shopsys/blob/master/packages/framework/src/Resources/views/Admin/Form/productCalculatedPrices.html.twig#L36) - this is not very practical - if I wanted to render the currency symbol properly, I would have to render the form widget manually in my template - this is not what I want to do.

I see there is currency option available for the type so I passed my currency code using this option. If I get it correctly, MoneyType should take into account the locale settings when displaying the currency symbol, however, it seems like it is not - using this approach with currency option, I should see after the input when I have cs locale set, but I see CZK :disappointed:

This might be slightly connected to https://github.com/shopsys/shopsys/pull/1675

Expected result

There is a clear and easy way how to render proper localized currency symbol after MoneyType input (preferably using currency option).

vitek-rostislav avatar Feb 21 '20 14:02 vitek-rostislav

I´ve had same problem, when I created MultidomainType with MoneyType 😞

LukStankovic avatar Jun 03 '20 12:06 LukStankovic

This issue has been automatically marked as stale because there was no activity within the last 4 months (and it is quite a long time). It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Oct 04 '20 02:10 stale[bot]

This issue has been automatically closed because there was no acivity within the last half a year.

stale[bot] avatar Dec 25 '20 11:12 stale[bot]