• Resolved abedelrazzak

    (@abedelrazzak)


    I made js to move the input field element from one place to another, but it gives an error

    “Uncaught TypeError: Cannot read properties of undefined (reading ‘length’)
    at HTMLInputElement.checkboxOnChange (front.min.js?ver=4.9.1:1:27912)
    at HTMLDocument.dispatch (jquery-3.6.4.min.js:2:43184)
    at y.handle (jquery-3.6.4.min.js:2:41168)”

    in this part of the plugin’s script in line 7:

    “checkboxOnChange = function() {
    var e = v(this)
    , t = e.closest(“.checkboxbutton”)
    , a = e.closest(“.yith-wapo-option”)
    , o = a.parent();
    let i = !1;
    a.data(“replace-image”).length <= 0 && (i = !0),
    “checked” !== e.attr(“checked”) ? (a.hasClass(“selection-single”) && (o.find(“input”).attr(“checked”, !1).prop(“checked”, !1),
    o.find(“.selected, .checked”).removeClass(“selected checked”)),
    e.attr(“checked”, !0).prop(“checked”, !0),
    a.addClass(“selected”),
    t.addClass(“checked”)) : (e.attr(“checked”, !1).prop(“checked”, !1),
    a.removeClass(“selected”),
    t.removeClass(“checked”),
    i = !0),
    replaceImageAction(a, i)
    }”

    In the page that I need help with, select add a balloon, put the qty to 2 or more and the price gets interrupted it won’t get incremented, check the console.

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

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support Alessio Torrisi

    (@alessio91)

    Hello there,

    thank you for contacting us.

    I’m sorry but I can’t provide you support for a custom solution. I’m here, if you need, for any issue on default plugin functions.

    Thread Starter abedelrazzak

    (@abedelrazzak)

    Hey thanks for the reply, I don’t want you to help me with my custom code, my question is why when moving the input field element I get an error from your plugin code, this was not an issue in the previous version.

    “Uncaught TypeError: Cannot read properties of undefined (reading ‘length’)
    at HTMLInputElement.checkboxOnChange (front.min.js?ver=4.9.1:1:27912)
    at HTMLDocument.dispatch (jquery-3.6.4.min.js:2:43184)
    at y.handle (jquery-3.6.4.min.js:2:41168)”
    
    in this part of the plugin’s script in line 7: (PLUGIN CODE NOT MINE)
    
    “checkboxOnChange = function() {
    var e = v(this)
    , t = e.closest(“.checkboxbutton”)
    , a = e.closest(“.yith-wapo-option”)
    , o = a.parent();
    let i = !1;
    a.data(“replace-image”).length <= 0 && (i = !0),
    “checked” !== e.attr(“checked”) ? (a.hasClass(“selection-single”) && (o.find(“input”).attr(“checked”, !1).prop(“checked”, !1),
    o.find(“.selected, .checked”).removeClass(“selected checked”)),
    e.attr(“checked”, !0).prop(“checked”, !0),
    a.addClass(“selected”),
    t.addClass(“checked”)) : (e.attr(“checked”, !1).prop(“checked”, !1),
    a.removeClass(“selected”),
    t.removeClass(“checked”),
    i = !0),
    replaceImageAction(a, i)
    }”
    Thread Starter abedelrazzak

    (@abedelrazzak)

    I fixed it, what I did is that I initialized the data attribute “replace-image” for the input fields as empty string, that resolved my problem.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘when moving the input field element to another place it gives error’ is closed to new replies.