Support » Plugin: MarketPress - WordPress eCommerce » Delete items from Shopping Cart Page 'jquery way'

  • Hey, there,

    I figured out how to delete items in “Shopping Cart Page” without pressing ‘update cart’ button lets say ‘jquery way’. Just check delete checkbox to see it in action. It works, but need your revision on this solution (working on quantity update) 😉

    In store.js add:

    //store.js delete item
    function mp_delete_item() {
            var mp_item = $(this).val();
            $.post(MP_Ajax.ajaxUrl, {action: 'mp-update-cart', update_cart_submit: 1, 'remove[]': mp_item }, function(vall) {
              mp_delete_item(); //re-init script

    In marketpress.php function update_cart() add:

    //remove items
      if (is_array($_POST['remove'])) {
        foreach ($_POST['remove'] as $pbid) {
    	  list($bid, $product_id, $variation) = split(':', $pbid);
            //save items to cookie
            //ajax thing
            if (defined('DOING_AJAX') && DOING_AJAX) {
            $return = _mp_cart_table('checkout-edit');
            echo $return;

  • The topic ‘Delete items from Shopping Cart Page 'jquery way'’ is closed to new replies.