calculateTaxes example

/** * Calculates the amount for a gross delivery. * `CalculatedPrice::netPrice` contains the summed gross prices minus amount of calculated taxes. * `CalculatedPrice::price` contains the summed gross prices * Calculated taxes are based on the gross prices */
    private function calculateGrossAmount(PriceCollection $prices, PriceCollection $shippingCosts, SalesChannelContext $context): CartPrice
    {
        $all = $prices->merge($shippingCosts);

        $total = $all->sum();
        $taxes = $this->calculateTaxes($all$context);

        $price = $this->rounding->cashRound(
            $total->getTotalPrice(),
            $context->getTotalRounding()
        );

        $net = $this->rounding->mathRound(
            $total->getTotalPrice() - $taxes->getAmount(),
            $context->getItemRounding()
        );

        
Home | Imprint | This part of the site doesn't use cookies.