Skip to content

Issue after placing an order with cart ^11.5 and TYPO3 v13.4 #714

Description

@chrcan

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

11.xrelated to TYPO3 v13

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions