2

I wanna delete an item from cart via ajax. I'm trying to use the method 'remove_order_item' from the WC_AJAX class: http://docs.woothemes.com/wc-apidocs/source-class-WC_AJAX.html.

I tried following javascript code. The server can successfully be called, but the item won't be deleted. What am I doing wrong?

 $.ajax({

            url:"/wp-admin/admin-ajax.php",
            type: "POST",
            data : "action=woocommerce_remove_order_item&order_item_ids=[someId]",
            success: function(data, textStatus, jqXHR)
            {         
                alert(textStatus);    
                alert(data);
            },
            error: function (jqXHR, textStatus, errorThrown)
            {
                alert(textStatus);        
            }
        });
Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
user1117605
  • 111
  • 2
  • 11
  • Try the solution in the following link http://stackoverflow.com/questions/21900865/remove-product-in-the-cart-using-ajax-in-woocommerce – Domain Jun 05 '15 at 05:30

0 Answers0