Zum Inhalt

Core-Hack

Wenn du steuerfreie Länder aktiviert hast, füge bitte unseren Core-Hack hinzu.

Betroffene Datei:
vendor/shopware/core/Checkout/Cart/CartRuleLoader.php

Vorher

<?php
private function validateTaxFree(SalesChannelContext $context, Cart $cart, CartBehavior $behaviorContext): Cart
{
    $totalCartNetAmount = $cart->getPrice()->getPositionPrice();
    if ($context->getTaxState() === CartPrice::TAX_STATE_GROSS) {
        $totalCartNetAmount = $totalCartNetAmount - $cart->getLineItems()->getPrices()->getCalculatedTaxes()->getAmount();
    }
}

Nachher

<?php
private function validateTaxFree(SalesChannelContext $context, Cart $cart, CartBehavior $behaviorContext): Cart
{
    $totalCartNetAmount = $cart->getPrice()->getPositionPrice();
    if ($context->getTaxState() === CartPrice::TAX_STATE_GROSS) {
        $totalCartNetAmount = $totalCartNetAmount - $cart->getLineItems()->getPrices()->getCalculatedTaxes()->getAmount();
    }
    if ($totalCartNetAmount < 0) {
        $totalCartNetAmount = 0;
    }
}