Configure United Kingdom VAT after Brexit

Con la nueva regla de impuestos impuesta para UK, que aplica el VAT solo si el importe es mayor a 135GBP, necesitamos modificar algunas cosas en nuestrop PrestaShop para cumplir con la norma.

Primero tendremos que tener correctamente configurado el VAT.
Lo siguiente es modificar el archivo Src/Adapter/Presenter/Cart/CartPresenter.php (a veces esta en Src/Adapter/Presenter).

En esta linea buscamos:

        if (Configuration::get('PS_TAX_DISPLAY')) {
            $taxAmount = $total_including_tax - $total_excluding_tax;
            $subtotals['tax'] = array(
                'type' => 'tax',
                'label' => ($this->includeTaxes())
                    ? $this->translator->trans('Included taxes', array(), 'Shop.Theme.Checkout')
                    : $this->translator->trans('Taxes', array(), 'Shop.Theme.Checkout'),
                'amount' => $taxAmount,
                'value' => $this->priceFormatter->format($taxAmount),
            );
        }
Y lo reemplazaremos por:
        if ($total_excluding_tax-$shippingCost > '135' &&  Context::getContext()->country->id == 17) {
        if (Configuration::get('PS_TAX_DISPLAY')) {
            $taxAmount = $total_including_tax - $total_excluding_tax;
            $subtotals['tax'] = array(
                'type' => 'tax',
                'label' => ($this->includeTaxes())
                    ? $this->translator->trans('Included taxes', array(), 'Shop.Theme.Checkout')
                    : $this->translator->trans('Taxes', array(), 'Shop.Theme.Checkout'),
                'amount' => $taxAmount,
                'value' => $this->priceFormatter->format($taxAmount),
            );
        }
        } elseif ($total_excluding_tax-$shippingCost < '135' &&  Context::getContext()->country->id == 17) {
        if (Configuration::get('PS_TAX_DISPLAY')) {
           /* $taxAmount = $total_including_tax - $total_excluding_tax;
            $subtotals['tax'] = array(
                'type' => 'tax',
                'label' => ($this->includeTaxes())
                    ? $this->translator->trans('Included taxes', array(), 'Shop.Theme.Checkout')
                    : $this->translator->trans('Taxes', array(), 'Shop.Theme.Checkout'),
                'amount' => $taxAmount,
                'value' => $this->priceFormatter->format($taxAmount),
            );*/
        }     
        } else {
        if (Configuration::get('PS_TAX_DISPLAY')) {
            $taxAmount = $total_including_tax - $total_excluding_tax;
            $subtotals['tax'] = array(
                'type' => 'tax',
                'label' => ($this->includeTaxes())
                    ? $this->translator->trans('Included taxes', array(), 'Shop.Theme.Checkout')
                    : $this->translator->trans('Taxes', array(), 'Shop.Theme.Checkout'),
                'amount' => $taxAmount,
                'value' => $this->priceFormatter->format($taxAmount),
            );
            } 
        }
En este caso le decimos que si el importe menos el envio es mayor a 135 $total_excluding_tax-$shippingCost > '135' y el pais es UK Context::getContext()->country->id == 17 (verifique el id de su pais) Aplique nuestra regla de tasas, y sino, no aplicara tasas.
Luego buscamos esta linea:
        $totals = array(
            'total' => array(
                'type' => 'total',
                'label' => $this->translator->trans('Total', array(), 'Shop.Theme.Checkout'),
                'amount' => $this->includeTaxes() ? $total_including_tax : $total_excluding_tax,
                'value' => $this->priceFormatter->format(
                    $this->includeTaxes() ? $total_including_tax : $total_excluding_tax
                ),
            ),
            'total_including_tax' => array(
                'type' => 'total',
                'label' => $this->translator->trans('Total (tax incl.)', array(), 'Shop.Theme.Checkout'),
                'amount' => $total_including_tax,
                'value' => $this->priceFormatter->format($total_including_tax),
            ),
            'total_excluding_tax' => array(
                'type' => 'total',
                'label' => $this->translator->trans('Total (tax excl.)', array(), 'Shop.Theme.Checkout'),
                'amount' => $total_excluding_tax,
                'value' => $this->priceFormatter->format($total_excluding_tax),
            ),
        );
Y reemplazamos por:
       if ($total_excluding_tax-$shippingCost > '135' && Context::getContext()->country->id == 17) {
        $totals = array(
            'total' => array(
                'type' => 'total',
                'label' => $this->translator->trans('Total', array(), 'Shop.Theme.Checkout'),
                'amount' => $this->includeTaxes() ? $total_including_tax : $total_including_tax,
                'value' => $this->priceFormatter->format(
                    $this->includeTaxes() ? $total_including_tax : $total_including_tax
                ),
            ),
            'total_including_tax' => array(
                'type' => 'total',
                'label' => $this->translator->trans('Total (tax incl.)', array(), 'Shop.Theme.Checkout'),
                'amount' => $total_including_tax,
                'value' => $this->priceFormatter->format($total_including_tax),
            ),
            'total_excluding_tax' => array(
                'type' => 'total',
                'label' => $this->translator->trans('Total (tax incl.)', array(), 'Shop.Theme.Checkout'),
                'amount' => $total_including_tax,
                'value' => $this->priceFormatter->format($total_including_tax),
            ),
        );
        } elseif ($total_excluding_tax-$shippingCost < '135' && Context::getContext()->country->id == 17) {
        $totals = array(
            'total' => array(
                'type' => 'total',
                'label' => $this->translator->trans('Total', array(), 'Shop.Theme.Checkout'),
                'amount' => $this->includeTaxes() ? $total_excluding_tax : $total_excluding_tax,
                'value' => $this->priceFormatter->format(
                    $this->includeTaxes() ? $total_excluding_tax : $total_excluding_tax
                ),
            ),
            'total_including_tax' => array(
                'type' => 'total',
                'label' => $this->translator->trans('Total', array(), 'Shop.Theme.Checkout'),
                'amount' => $total_excluding_tax,
                'value' => $this->priceFormatter->format($total_excluding_tax),
            ),
            'total_excluding_tax' => array(
                'type' => 'total',
                'label' => $this->translator->trans('Total', array(), 'Shop.Theme.Checkout'),
                'amount' => $total_excluding_tax,
                'value' => $this->priceFormatter->format($total_excluding_tax),
            ),
        );

    } else {
        $totals = array(
            'total' => array(
                'type' => 'total',
                'label' => $this->translator->trans('Total', array(), 'Shop.Theme.Checkout'),
                'amount' => $this->includeTaxes() ? $total_including_tax : $total_excluding_tax,
                'value' => $this->priceFormatter->format(
                    $this->includeTaxes() ? $total_including_tax : $total_excluding_tax
                ),
            ),
            'total_including_tax' => array(
                'type' => 'total',
                'label' => $this->translator->trans('Total (tax incl.)', array(), 'Shop.Theme.Checkout'),
                'amount' => $total_including_tax,
                'value' => $this->priceFormatter->format($total_including_tax),
            ),
            'total_excluding_tax' => array(
                'type' => 'total',
                'label' => $this->translator->trans('Total (tax excl.)', array(), 'Shop.Theme.Checkout'),
                'amount' => $total_excluding_tax,
                'value' => $this->priceFormatter->format($total_excluding_tax),
            ),
        );  
    }
la ultima seccion a reemplazar sera.

        $labels = array(
            'tax_short' => ($this->includeTaxes())
                ? $this->translator->trans('(tax incl.)', array(), 'Shop.Theme.Global')
                : $this->translator->trans('(tax excl.)', array(), 'Shop.Theme.Global'),
            'tax_long' => ($this->includeTaxes())
                ? $this->translator->trans('(tax included)', array(), 'Shop.Theme.Global')
                : $this->translator->trans('(tax excluded)', array(), 'Shop.Theme.Global'),
        );
por:

        if ($total_excluding_tax-$shippingCost > '135' && Context::getContext()->country->id == 17) {
        $labels = array(
            'tax_short' => ($this->includeTaxes())
                ? $this->translator->trans('(tax incl.)', array(), 'Shop.Theme.Global')
                : '',
            'tax_long' => ($this->includeTaxes())
                ? $this->translator->trans('(tax included)', array(), 'Shop.Theme.Global')
                : $this->translator->trans('(tax excluded)', array(), 'Shop.Theme.Global'),
        );
    } elseif ($total_excluding_tax-$shippingCost < '135' && Context::getContext()->country->id == 17){
        $labels = array(
            'tax_short' => ($this->includeTaxes())
                ? $this->translator->trans('', array(), 'Shop.Theme.Global')
                : '',
            'tax_long' => ($this->includeTaxes())
                ? $this->translator->trans('(tax included)', array(), 'Shop.Theme.Global')
                : $this->translator->trans('(tax excluded)', array(), 'Shop.Theme.Global'),
        );
        } else {
            $labels = array(
                'tax_short' => ($this->includeTaxes())
                    ? $this->translator->trans('(tax incl.)', array(), 'Shop.Theme.Global')
                    :  $this->translator->trans('(tax excl.)', array(), 'Shop.Theme.Global'),
                'tax_long' => ($this->includeTaxes())
                    ? $this->translator->trans('(tax included)', array(), 'Shop.Theme.Global')
                    : $this->translator->trans('(tax excluded)', array(), 'Shop.Theme.Global'),
            );

        }

Y con esto seria suficiente. En las reglas se pueden colocar mas correcciones y ajustar el codigo para tomar el 135 a la conversion correcta si es otra moneda.

Carro 0 Carrito de compras

sin productos

¡Envío gratis! Envío
$0.00 Total

Revisa