首页 > 解决方案 > ajax 查询有什么问题,没有连接和成功查询 laravel?

问题描述

我的添加到购物车 ajax 请求有问题,这不会导致我正在处理的 laravel 项目。问题是本地一切都运行良好:

 async function add_cart(row_id,variant) {
    $('#cover-spin').show(0);
    $.ajax({
        type: "get",
        url: APP_URL + "/cart/add/" + row_id,
        data: {quantity: 1,variants: variant},
        success: function (response) {
            if (response) {
                $('#search-keyword').keyup();
                refreshCartPage();
                updateCartCount();
                setTimeout(function(){ $('#cover-spin').hide(0); }, 1000);
                toastr.options.closeButton = true;
toastr.success("Produit ajouter au panier");
            } else {
                refreshCartPage();
                setTimeout(function(){ $('#cover-spin').hide(0); }, 1000);
                toastr.options.closeButton = true;
                toastr.error("Quelque chose c'est mal passé");
            }
        },
        error: function (response) {
            refreshCartPage();
            setTimeout(function(){ $('#cover-spin').hide(0); }, 1000);
        }
    });
}

这是有问题的shoppypagne网站的链接。

你知道如何解决这个问题吗?

提前致谢。:)

标签: laravel

解决方案


推荐阅读