Close

Ajax Cart Broke On Homepage

final_thrill
5 years ago
#14978 Quote
Avatar
  • 9
I'm working on a 4.0 site that has several of the Seven Spikes plugins installed.  We have an error on the homepage coming from the Ajax Cart Plugin.  This only seems to occur on the homepage itself, and the plugin is otherwise functional.  This error is causing problems on the homepage.  For example the flyout cart doesn't work because of it.  I've tried re-installed all Seven Spikes plugins including the core, however that didn't make any difference.  The error is as follows:

Uncaught TypeError: a(...).kendoWindow is not a function
    at M (AjaxCart.min.js:formatted:433)
    at HTMLDocument.<anonymous> (AjaxCart.min.js:formatted:524)
    at c (jquery-1.10.2.min.js:4)
    at Object.fireWith [as resolveWith] (jquery-1.10.2.min.js:4)
    at Function.ready (jquery-1.10.2.min.js:4)
    at HTMLDocument.q (jquery-1.10.2.min.js:4)

Code:

    function M() {
        var t = f()
          , o = a(t);
        if (o.length > 0) {
            o.prepend('<div class="addProductToCartErrors"></div><div class="addProductVariantToCartErrors"></div><div class="miniProductDetailsView"></div><div class="productAddedToCartWindow"></div>');
            var e = a(".miniProductDetailsView").kendoWindow({
                draggable: !1,
                resizable: !1,
                modal: !0,
                actions: ["Close"],
                animation: !1,
                visible: !1
            }).data("kendoWindow");
            e.wrapper.addClass("ajaxCart"),
            a(document).on("click", ".k-overlay", function() {
                e.close()
            })
        }
        var r = a(".productAddedToCartWindow").kendoWindow({
            draggable: !1,
            resizable: !1,
            modal: !0,
            actions: ["Close"],
            animation: !1,
            visible: !1
        }).data("kendoWindow");
        r.wrapper.addClass("ajaxCart"),
        a(document).on("click", ".k-overlay", function() {
            r.close()
        })
    }
final_thrill
5 years ago
#14979 Quote
Avatar
  • 9
The script file is AjaxCart.min.js
SDobrev
5 years ago
#14981 Quote
Avatar
  • 283
Hi,

Could you please submit a ticket and provide URL to your store so we can further investigate this issue?

The Ajax Cart requires some Kendo files which are included in nopCommerce by default. Have you made any custom modifications to the nopCommerce?
Best Regards,
Stoyan Dobrev
Nop-Templates.com
final_thrill
5 years ago
#14983 Quote
Avatar
  • 9
Thanks your your reply.  Unfortunately I can do neither because our license has expired to submit a ticket, and the site in question is currently not public facing.  We do have some custom code on the website.  It seems to me like the scripts aren't being loaded in the correct order.  Can you advise me on how I could enforce the script load order?
final_thrill
5 years ago
#14984 Quote
Avatar
  • 9
This error occurs because of a custom script we had running on the homepage.  It had nothing to do with any of the 7 Spikes plugins.  This thread can be closed.  Thanks for your advice.