Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Graham Carr 277 posts 389 karma points
    Apr 22, 2015 @ 12:15
    Graham Carr
    0

    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?

  • Ismail Mayat 4511 posts 10059 karma points MVP 2x admin c-trib
    Apr 22, 2015 @ 18:20
    Ismail Mayat
    0

    Graham,

    We did it with some jquery:

        $('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);
                }
            }
        });

    Regards

    Ismail

  • Bjarne Fyrstenborg 1182 posts 3441 karma points MVP 4x c-trib
    Apr 22, 2015 @ 18:34
    Bjarne Fyrstenborg
    0

    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

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies