What is the best way to go about altering TeaCommerce so that an order can only be checked out if the order total is over a specified amount, such as £15?
$('a#next').click(function (e) {
var minimum = parseFloat($('#minimum-spend').val());
var rawAmount = $('#totalExVAT td.money').text().split(',').join('');
var actual = parseFloat(rawAmount.replace(/\u00A3/g, ''));
if (actual >= 0 && minimum >= 0) {
if (actual < minimum) {
e.preventDefault();
alert("Your minimum purchase must be greater than or equal to \u00A3" + minimum);
}
}
});
If you are using Tea Commerce v2 or v3, you could also use the JavaScript and Razor API to access the order object and e.g. disable next button, display a popup message or some other kind of feedback to the customer.. maybe even disable "go to checkout" until the customer has products in cart for more than £15.
Order must be over X amount
What is the best way to go about altering TeaCommerce so that an order can only be checked out if the order total is over a specified amount, such as £15?
Graham,
We did it with some jquery:
Regards
Ismail
Hi Graham
If you are using Tea Commerce v2 or v3, you could also use the JavaScript and Razor API to access the order object and e.g. disable next button, display a popup message or some other kind of feedback to the customer.. maybe even disable "go to checkout" until the customer has products in cart for more than £15.
/Bjarne
is working on a reply...