-
-
Notifications
You must be signed in to change notification settings - Fork 56
Open
Description
After placing an order using cart version ^11.5, I immediately get the following error:
PHP Warning: Undefined array key 1 in /var/www/html/vendor/extcode/cart/Classes/Domain/Model/Cart/Cart.php line 341
I fixed this issue by replacing the affected code with the following snippet and the warning disappeared:
public function getTotalTaxes(): array
{
$taxes = $this->getSubtotalTaxes();
$serviceTaxes = $this->getServiceTaxes();
foreach ($serviceTaxes as $taxClassId => $tax) {
$taxes[$taxClassId] = ($taxes[$taxClassId] ?? 0.0) + $tax;
}
$couponTaxes = $this->getCouponTaxes();
foreach ($couponTaxes as $taxClassId => $tax) {
$taxes[$taxClassId] = ($taxes[$taxClassId] ?? 0.0) - $tax;
}
return $taxes;
}https://github.com/extcode/cart/blob/main/Classes/Domain/Model/Cart/Cart.php#L335-L350
Metadata
Metadata
Assignees
Labels
No labels