Jump to content

[Solved] Limit maximum price of an order


Recommended Posts

Hello everyone,

 

I was wondering if we could limit the maximum price of a basket ?

I know it could seem strange, but I need to do this, and I didn't find the option nor a module / a topic giving a solution. So before posting in Developement to try to do it manually, I'm asking here in case anybody had to do this.

I know I can write it everywhere on the shop, make a popup to warn clients and all, but it would be far easier if I could just prevent them to confirm order.

A dirty solution is to use a tax for people above this limit, but it's really not user friendly, even with an explanation ( and quite sure it's not legal too ).

 

Thanks in advance

Edited by Xuân (see edit history)
Link to comment
Share on other sites

Kk, did it like that :

on shopping-cart.tpl, around line 565

{if !$opc}
			{if $total_price<20000 }
			<a  href="{if $back}{$link->getPageLink('order', true, NULL, 'step=1&back={$back}')|escape:'html':'UTF-8'}{else}{$link->getPageLink('order', true, NULL, 'step=1')|escape:'html':'UTF-8'}{/if}" class="button btn btn-default standard-checkout button-medium" title="{l s='Proceed to checkout'}">
				<span>{l s='Proceed to checkout'}<i class="icon-chevron-right right"></i></span>
			</a>
			{else}
			<p id="price_limit_reached"> Pour une commande de plus de 20 000€, veuillez nous contacter directement SVP </p>
			{/if}
		{/if}

The {if $total_price<20000} and {else} are the code I added. Then, write whatever you want after the else and close with the {/if}

Link to comment
Share on other sites

  • 2 weeks later...
Thanks, I was looking for something like this.

 

Could you please advise me how to apply the condition to certain countries. Let's suppose that I want limit the maximum price of an order for USA and Canada only.

 

Ed

Link to comment
Share on other sites

Erh, I don't think I can... I'll need to check my files when I'll have access to them, so next monday mb. Try to look for a global var with country to add to your if maybe ? So it would be like {if($total_price>20000 && $country=='Canada'}

Edited by Xuân (see edit history)
Link to comment
Share on other sites

  • 5 years later...

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...