Support » Plugin: CoCart - Decoupling WooCommerce Made Easy » add-item end point is throwing rest_no_route 404 error

  • Resolved nareshdevineni


    Hi, we have a Woocommerce website that is integrated with CoCart lite plugin.

    Things were working fine until yesterday. But suddenly, the Add to Cart functionality was broken.

    The following end point is giving us 404 No Route was found error.

    Here is the error message to be precise:

    {"code":"rest_no_route","message":"No route was found matching the URL and request method.","data":{"status":404}}

    The other end points are working fine.

    For example, this end point is working as expected:

    All the plugins are up to date including CoCart and Woocommerce. We tried reverting back to an older version of CoCart, but no luck.

    Here is the Javascript Code that used to work till yesterday:

    function rest_api_cart() {
    		".product:not(.product-type-external) .single_add_to_cart_button:not(.add-to-cart-button-reject)"
    		".product:not(.product-type-external) .single_add_to_cart_button:not(.add-to-cart-button-reject)",
    		function (e) {
    			var _this = jQuery(this);
    			var _product_id = _this.val();
    			var _form = _this.closest("form");
    			var _form_data = _form.serialize();
    			if (_product_id != "") {
    				var _data = "add-to-cart=" + _product_id + "&" + _form_data;
    			} else {
    				var _data = _form_data;
    			if (".disabled") ||".wc-variation-selection-needed")
    			) {
    				return false;
    			_data = "return_cart=false&" + _data;
    			var atcUrl = "";
    				type: "POST",
    				url: atcUrl,
    				data: _data,
    				dataType: "html",
    				cache: false,
    				headers: { "cache-control": "no-cache" },
    				success: function () {
    					jQuery(document).on("added_to_cart", function () {

    Please let us know what you think. Any direction to fixing this problem would be helpful.

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘add-item end point is throwing rest_no_route 404 error’ is closed to new replies.