Re: Is it possible to do this math in Twig?
Posted: Thu Oct 26, 2017 8:08 pm
I would not suggest using the number_format function since Opencart uses the Yahoo Finance API as it could affect the currency exchange settings on your site. As for the discount.after_discount, that is correct since the discounts is an array being extracted into the TWIG file and should not be using brackets to output the value. However, my PHP code above should work already as it is in compliance with the currency exchange output.
The number_format value with decimal of 2 would be more compliant with shipping modules such as the UPS and USPS which those two providers enforces the decimal of 2, for instance.
As for the Journal2, I really have to say here, as a positive input, that I would never expect someone having to go this far to find out the truth about the cache that this add-on is failing to process and for the publisher to have failed the delivery of its product. Great troubleshooting !
The number_format value with decimal of 2 would be more compliant with shipping modules such as the UPS and USPS which those two providers enforces the decimal of 2, for instance.
As for the Journal2, I really have to say here, as a positive input, that I would never expect someone having to go this far to find out the truth about the cache that this add-on is failing to process and for the publisher to have failed the delivery of its product. Great troubleshooting !