Jump to content

How set "minimum purchase total required" with including taxes


tinama

Recommended Posts

Hello,

 

Of default, in preferences > orders, the "minimum purchase total required in order to validate the order" is tax excl.,

while I'd like to set it with tax included.

 

I have an e-commerce:.

- done with 1.6.1.5 version;

- what has products with different taxes (4%, 10% and 22%),

- order process type:  standard (5 steps);

- enable guest checkout:  yes

 

How can fix that feature?

Thanks

Edited by tinama (see edit history)
Link to comment
Share on other sites

  • 2 years later...

Hi! Here is how to solve it with 1.7

Edit file src/Adapter/Cart/CartPresenter.php

find following code and  change $productsTotalExcludingTax to $totalCartAmount so the minimum amount or Cart is TAX included

Below is code already with changes

return array(
            'products' => $products,
            'totals' => $totals,
            'subtotals' => $subtotals,
            'products_count' => $products_count,
            'summary_string' => $summary_string,
            'labels' => $labels,
            'id_address_delivery' => $cart->id_address_delivery,
            'id_address_invoice' => $cart->id_address_invoice,
            'is_virtual' => $cart->isVirtualCart(),
            'vouchers' => $vouchers,
            'discounts' => $discounts,
            'minimalPurchase' => $minimalPurchase,
            'minimalPurchaseRequired' => ($this->priceFormatter->convertAmount($totalCartAmount) < $minimalPurchase) ?
                $this->translator->trans(
                    'A minimum shopping cart total of %amount% (tax excl.) is required to validate your order. Current cart total is %total% (tax excl.).',
                    array(
                        '%amount%' => $this->priceFormatter->convertAndFormat($minimalPurchase),
                        '%total%' => $this->priceFormatter->convertAndFormat($totalCartAmount),
                    ),
                    'Shop.Theme.Checkout'
                ) :
                '',
        );

 

  • Like 2
  • Thanks 1
Link to comment
Share on other sites

  • 9 months later...

Thank you.

For 1.7.6.4 the needed modification is in

src/Adapter/Presenter/Cart/Cartpresenter.php

Search

'minimalPurchaseRequired' => ($productsTotalExcludingTax < $minimalPurchase) ?

Replace with

'minimalPurchaseRequired' => ($totalCartAmount < $minimalPurchase) ?

Don't forget to edit the language file for taxes text.

 

Edited by Courage2000 (see edit history)
  • Like 1
  • Thanks 1
Link to comment
Share on other sites

  • 3 years later...
On 4/9/2020 at 4:09 PM, Courage2000 said:

Thank you.

For 1.7.6.4 the needed modification is in

src/Adapter/Presenter/Cart/Cartpresenter.php

Search

'minimalPurchaseRequired' => ($productsTotalExcludingTax < $minimalPurchase) ?

Replace with

'minimalPurchaseRequired' => ($totalCartAmount < $minimalPurchase) ?

Don't forget to edit the language file for taxes text.

 

Sorry if I bring this topic up again, but it's first on Google and I think it's leading a lot of people astray..
There is a problem here I think, I haven't tried the code, but you are comparing a price including tax, with a minimum purchase which is tax free.. That's not good.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...