0

How can we easy check if the {order_subtotal} has a minimum of 50.00 on the first checkout page in Store. {order_subtotal} holds the amount together with the currency indicator and can therefor not be used for evaluating the amount with a simple if conditional.

Is there another tag with the only the value of the sub_total? Or do we need to manipulate with PHP here?

We want to deactivate the Continue button in the checkout process if the sub_total is not 50.00 (or whatever amount) and show a message.

0

You can add _val to any price variables to get the unformatted version in any of the store tags (orders, product, checkout, cart) to use in conditionals.

All price variables are pre-formatted according to your currency formatting settings. If you want the unformatted amount, simply append _val to the variable.

It is mentioned in the docs in passing here.

So in your checkout template you will want to have something along the lines of:

{if order_subtotal_val > 50}
 Your Subtotal is over $50.00 logic
{if:else}
 Lets add some more items to the cart your subtotal isn't $50.00
{/if}
| improve this answer | |
  • Very good,thanks. A more prominent place in the docs for this information could help too. – Werner Gusset Dec 6 '15 at 7:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.