Saleor: Products cannot be updated in currencies that do not use decimal

Created on 17 Mar 2020  路  4Comments  路  Source: mirumee/saleor

What I'm trying to achieve

If I set DEFAULT_CURRENCY as ISK (or another currencies that include "I" for ex: IDQ, IIR) I cannot update products.

(When I set DEFAULT_CURRENCY as lowercase it works fine.)

Error:
{"data": {"productUpdate": {"errors": [{"field": "minimalVariantPriceAmount", "message": "Ensure that there are no more than 0 decimal places.", "__typename": "Error"}], "product": null, "__typename": "ProductUpdate"}}}

Steps to reproduce the problem

  1. Set DEFAULT_CURRENCY as "ISK" and DEFAULT_COUNTRY as "IS"
  2. Run the project.
  3. Try to update any products.

System information
Operating system: Both MacOS and Ubuntu 18.04

bug

All 4 comments

I guess this could be moved to saleor-dashboard, the problem is that these currencies (and Japanese Yen for example) do not have any decimal places and the dashboard submits an amount with a precision of 1/100.

We could also attempt to strip non-significant zeroes from amounts before validating their precision in the core. @maarcingebala?

Hi @patrys thank you for the redirection.

I made DEFAULT_DECIMAL_PLACES = 2 as a temporary solution. Everything is looking well.

Hope it will be solved permanently soon.

Thanks in advance.

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

PiotrCzapla picture PiotrCzapla  路  3Comments

Pacu2 picture Pacu2  路  4Comments

NumanIjaz picture NumanIjaz  路  3Comments

gComet picture gComet  路  3Comments

damianarechar picture damianarechar  路  3Comments