THELIA Forum

Welcome to the THELIA support and discusssion forum

Announcement

Rejoignez la communauté sur le Discord Thelia : https://discord.gg/YgwpYEE3y3

Offline

#1 Probleme filtrage float

(16-09-2014 14:28:32)


J'ai aléatoirement le message suivant, quand j'ai un article dans mon panier :

TaxEngineException: BAD AMOUNT FORMAT

in .../thelia/core/lib/Thelia/TaxEngine/Calculator.php line 143
at Calculator->getTaxedPrice('2,31') in .../thelia/core/lib/Thelia/Model/CartItem.php line 118
at CartItem->getTaxedPrice(object(Country)) in .../thelia/core/lib/Thelia/Core/Template/Loop/Cart.php line 101

C'est ici que çà plante :
  if (false === filter_var($untaxedPrice, FILTER_VALIDATE_FLOAT)) {
            throw new TaxEngineException('BAD AMOUNT FORMAT', TaxEngineException::BAD_AMOUNT_FORMAT);
   }


Je comprend le message (on passe en paramètre 2,31 au lieu de 2.31, et aucune option 'decimal' n'est passé à filter_var).
Mais je ne vois pas pourquoi çà se produit (et encore moins aléatoirement).

C'est dejà arrivé à quelqu'un ?

(PHP : 5.5.16)