I have a calculation that calculates the tax when a user checks out using Cartridge
as my shop framework.
tax = tax * Decimal(str(settings.SHOP_DEFAULT_TAX_RATE))
The calculation works properly.I then pass tax
to set_tax(request, _("GST+PST"), tax)
When I do that, I get an error Decimal('12.0') is not JSON serializable
.
When I convert it to a float (set_tax(request, _("GST+PST"), float(tax))
it works; but when I go through the checkout I get this error:
unsupported operand type(s) for +=: 'Decimal' and 'float'
In my settings:
SHOP_DEFAULT_TAX_RATE = 0.12
I've seen solutions where I need to use a custom JSONEncoder but the error occurs inside Django itself.
Thanks.