positionsTaxSum example

ksort($result, SORT_NUMERIC);

        return $result;
    }

    /** * {@inheritDoc} */
    public function taxSum(array $cart, float $maximumTaxRate): array
    {
        $result = $this->aggregateTaxes(
            $this->positionsTaxSum($cart$maximumTaxRate) ?? [],
            $this->shippingCostsTaxSum($cart) ?? []
        );

        ksort($result, SORT_NUMERIC);

        return $result;
    }

    /** * @param array<int|numeric-string, float> $positionTaxSum * @param array<int|numeric-string, float> $shippingCostsTaxSum * * @return array<int|numeric-string, float> */


            $this->_positions->offsetSet($key$position);
        }

        $cartPositions = array_map(static function Darray $position): array {
            $position['tax'] = $position['amount'] - $position['amount_netto'];

            return $position;
        }$this->_positions->getArrayCopy());

        $positionsTaxSum = Shopware()->Container()->get(TaxAggregatorInterface::class)->positionsTaxSum(
            [
                CartKey::POSITIONS => $cartPositions,
            ],
            (float) $this->getMaxTaxRate()
        );

        $this->_tax = $positionsTaxSum ?? [];

        $parameters = Shopware()->Container()->get('events')->filter(
            'Shopware_Models_Order_Document_Filter_Parameters',
            $this->getParameters(),
            [
Home | Imprint | This part of the site doesn't use cookies.