yireo / Yireo_GoogleTagManager2

Open Software License 3.0
143 stars 73 forks source link

Wrong type casting in yireo/magento2-googletagmanager2/DataLayer/Mapper/ProductDataMapper.php #120

Closed jakwinkler closed 1 year ago

jakwinkler commented 1 year ago

In this file, line 73 there is wrong type casting

[2023-01-31 10:46:58] main.CRITICAL: TypeError: Argument 1 passed to Yireo\GoogleTagManager2\Util\PriceFormatter::format() 
must be of the type float, string given, called in /home/project/release/2023-01-31-08-28/vendor/yireo/magento2-googletagmanager2/DataLayer/Mapper/ProductDataMapper.php on line 73 and 
defined in /home/project/release/2023-01-31-08-28/vendor/yireo/magento2-googletagmanager2/Util/PriceFormatter.php:16

FinalPrice returns string $productData['price'] = $this->priceFormatter->format($product->getFinalPrice());

jissereitsma commented 1 year ago

Thanks for addressing this. Everywhere else the formatter was called while casting the relevant argument to a float .... except here. Fixed it and released 3.0.10 with it.

jakwinkler commented 1 year ago

Awesome, and thanks for great module :-)

sprankhub commented 1 year ago

So... We can close this? :)

jissereitsma commented 1 year ago

I guess so :)