We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 20178
    • 82 Posts
    i would love to itegrate formit and simplecart.js to give a really quick and easy cart system for modx revolution. it’s really easy to get modx & simple cart going together..

    the files for simplecart are below; -this is for the email branch;

    https://github.com/thewojogroup/simplecart-js/tree/email

    the part of the simplecart.js that calls the email.php is below;

    me.emailCheckout = function() {
    var div = me.updateCartView( document.createElement("div") );
    div = "<div class=’simpleCart_items’>" + div.innerHTML + "</div>";
    $.post("emaail.php" , {div:div} , function(data) {
    alert( data );
    });
    };


    The call on the page the presents the js cart and checkout are;



    <p>
    Cart: <span class="simpleCart_total"></span> (<span class="simpleCart_quantity"></span> items)


    <a href="javascript:;" class="simpleCart_empty">empty cart</a>


    </p>




    <div class="simpleCart_items" >
    </div>




    SubTotal: <span class="simpleCart_total"></span>

    Tax: <span class="simpleCart_taxCost"></span>

    Shipping: <span class="simpleCart_shippingCost"></span>

    -----------------------------

    Final Total: <span class="simpleCart_finalTotal"></span>


    <a href="javascript:;" class="simpleCart_checkout">checkout</a>


    if i have a formit call on the page is there away to post the contents of the cart data to the formit call?

    [[!FormIt?
    &hooks=`spam,email`
    &emailTpl=`MyEmailChunk`
    &emailTo=`[email protected]`
    &redirectTo=`123`
    &validate=`name:required,
    email:email:required,

    ]]

    many thanks in advance...