getTaxCalculationType example


        return $this->context->getTaxState();
    }

    public function setTaxState(string $taxState): void
    {
        $this->context->setTaxState($taxState);
    }

    public function getTaxCalculationType(): string
    {
        return $this->getSalesChannel()->getTaxCalculationType();
    }

    /** * @return array<string, bool> */
    public function getPermissions(): array
    {
        return $this->permissions;
    }

    /** * @param array<string, bool> $permissions */
'accessKey' => $id,
            'languages' => [['id' => Defaults::LANGUAGE_SYSTEM]],
        ];

        $this->salesChannelRepository->create([$data], Context::createDefaultContext());

        /** @var SalesChannelEntity $salesChannel */
        $salesChannel = $this->salesChannelRepository
            ->search(new Criteria([$id]), Context::createDefaultContext())
            ->first();

        static::assertSame(SalesChannelDefinition::CALCULATION_TYPE_HORIZONTAL, $salesChannel->getTaxCalculationType());
    }
}
$price,
            $prices->sum()->getTotalPrice(),
            $taxes,
            $total->getTaxRules(),
            CartPrice::TAX_STATE_NET,
            $total->getTotalPrice() + $taxes->getAmount()
        );
    }

    private function calculateTaxes(PriceCollection $prices, SalesChannelContext $context): CalculatedTaxCollection
    {
        if ($context->getTaxCalculationType() === SalesChannelDefinition::CALCULATION_TYPE_HORIZONTAL) {
            $taxes = $prices->getCalculatedTaxes();

            $taxes->round(
                $this->rounding,
                $context->getItemRounding()
            );

            return $taxes;
        }

        $price = $prices->sum();

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