- Issue created by @stefdewa
- Status changed to Needs review
over 1 year ago 8:58am 17 July 2023
Gateways where shopping carts are allowed (f.e. Klarna) give warnings for products with no weight.
In src/Helpers/OrderHelper.php function getShoppingCartData variable $productWeight is declared (line 547 till 553). This can be NULL. At line 585 and 586 $productWeight is accessed as an array. If $productWeight is NULL then this will result in a warning on PHP 7.4 or higher.
Use a gateway where shopping carts are allowed (f.e. Klarna) and buy a product without a weight.
A simple isset check before accessing the $productWeight variable will fix the warning.
Needs review
3.1
Code