Jump to content

minimum purchase check calculates with tax excl. -> I need incl.


Recommended Posts

	/* Check minimal amount */
		$currency = Currency::getCurrency((int)$this->context->cart->id_currency);

		$minimalPurchase = Tools::convertPrice((float)Configuration::get('PS_PURCHASE_MINIMUM'), $currency);
		if ($this->context->cart->getOrderTotal(false, Cart::ONLY_PRODUCTS) < $minimalPurchase)
			return '<p class="warning">'.sprintf(
				Tools::displayError('A minimum purchase total of %1s (tax excl.) is required in order to validate your order, current purchase total is %2s (tax excl.).'),
				Tools::displayPrice($minimal_purchase, $currency), Tools::displayPrice($this->context->cart->getOrderTotal(false, Cart::ONLY_PRODUCTS), $currency)
			).'</p>';

That code is in controllers/front/OrderOpcController.php

 

What I need is that Prestashop calculates with the prices tax included.

 

That way it is more transparent for my customers. How must the code look?

 

 

thanks

Link to comment
Share on other sites

I looked for sth like "getOrderTotalWT" (with tax) but did not work. And yes, now you know, I still have no clue where to look for the screws in Presta :)

 

So I am boldly asking this, too, since it could also work if there is no variable or so I could use:

if ($this->context->cart->getOrderTotal(false, Cart::ONLY_PRODUCTS) < $minimalPurchase*1.19)

The idea is that < $minimalPurchase*1.19) prompts the customer only if cart sum incl. tax is under let's say 25 $.

 

Minimum purchase shall be set to 25 $ incl. Tax. My tax rate is 19% !

 

 

Would sth like this work?

Link to comment
Share on other sites

I attached a screeni to show you more picturesque what I mean. I think this is very confusing for my customers. At least I must say it is for me and I really'd appreciate it to have the check be based on the total produt(s) price incl. tax.

 

Can some one help please?

post-402975-0-19416400-1401020835_thumb.png

Link to comment
Share on other sites

  • 4 weeks later...

Aloha

 

just another try to get an expert on board.

 

All I need is to make Prestashop make use of the price incl. tax.

 

I hope that it is merely a variable that may be to be changed`?

As it is I can't use it and it very frustrating that this is handled so restrictively. May be we can smash the constraints :)

Link to comment
Share on other sites

  • 1 month later...
  • 3 weeks later...

No solution but a workarround.

 

--> I went into translations in BO and just rewrote the whole chunk for the minimal purchase warning.

Mine says now plainly that customers need to but at least for n € ...

 

sometimes things are so annoying with Prestashop issues and sometimes I am so happy that there is Prestashop :)

Link to comment
Share on other sites

×
×
  • Create New...