Jump to content

Edit History

Pandal

Pandal

Thanks a lot for listing all the files to edit to make negative cart rules work.

In new versions of prestashop you must change this too:

/src/Adapter/Presenter/Cart/CartPresenter.php

Change

    private function cartVoucherHasAmountReduction($cartVoucher)
    {
        return isset($cartVoucher['reduction_amount']) && $cartVoucher['reduction_amount'] > 0;
    }

With
 

    private function cartVoucherHasAmountReduction($cartVoucher)
    {
        return isset($cartVoucher['reduction_amount']);
    }


And if you use % discount too, in the same file,

change

    private function cartVoucherHasPercentReduction($cartVoucher)
    {
        return isset($cartVoucher['reduction_percent'])
            && $cartVoucher['reduction_percent'] > 0
            && $cartVoucher['reduction_amount'] == '0.00';
    }

with
 

    private function cartVoucherHasPercentReduction($cartVoucher)
    {
        return isset($cartVoucher['reduction_percent'])
            && $cartVoucher['reduction_amount'] == '0.00';
    }



Hope this can help someone else.

Pandal

Pandal

Thanks a lot for listing all the files to edit to make negative cart rules work.

In new versions of prestashop you must change this too:

/src/Adapter/Presenter/Cart/CartPresenter.php

Change

    private function cartVoucherHasAmountReduction($cartVoucher)
    {
        return isset($cartVoucher['reduction_amount']) && $cartVoucher['reduction_amount'] > 0;
    }

With
 

    private function cartVoucherHasAmountReduction($cartVoucher)
    {
        return isset($cartVoucher['reduction_amount']);
    }


And if you use % discount too, in the same file,

change

    private function cartVoucherHasPercentReduction($cartVoucher)
    {
        return isset($cartVoucher['reduction_percent'])
            && $cartVoucher['reduction_percent'] > 0
            && $cartVoucher['reduction_amount'] == '0.00';
    }

with
 

    private function cartVoucherHasPercentReduction($cartVoucher)
    {
        return isset($cartVoucher['reduction_percent'])
            && $cartVoucher['reduction_amount'] == '0.00';
    }



Hope this can help someone else.

×
×
  • Create New...