Jump to content

Limit order ammount - easy code only works partially


seok

Recommended Posts

Hello

I am limiting the total order ammount in checkout and my code only works if is upper than 1.000 €

My code:

{if $total_cart > 0 && $total_cart < 3.000}
<button id="buy"></buton>
{else}
If you order is upper than 3000€, please contact-us
{/if}

First i tried with {if $total_cart < 3000} and also adding a dot "3.000" it works

The problem is that this code {if $total_cart < 3.000} only works if the order is between 1000 and 3000€.

Why this code is not working for orders less than €1000 ?

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

On 8/23/2023 at 4:38 PM, seok said:

but in tpl file is not working your code because gives error. 

i tried wihout luck the code: {if (intval($total_cart) < 3000)}

I wasn't aware you were in Smarty instead of PHP. Anyway, a little googling would have been enough for you to fix that problem.

Try {if (($total_cart*1) < 3000)}

Link to comment
Share on other sites

Without luck, with {if (($total_cart*1) < 3000)} it not detect the code, if I add a dot to 3000 {if (($total_cart*1) < 3.000)} then the code is detected but only works in orders between 1000 and 3000

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