Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #1287559
    Kathy Darling
    Guest

    Hi there,

    I’m the author of the WooCommerce Mix and Match Products plugin. I regularly get support tickets from mutual users who are using your theme but the plus/minus quantity buttons aren’t working with my plugin.

    There is this issue in your forums: https://kriesi.at/support/topic/mix-and-match-does-not-count-with-enfold-theme

    Which recommends using an alternative to the theme’s script compression. Now, It’s hard for me to read the un-minified scripts, but I think there may also be an issue in the plus/minus buttons’ quantity calculations:

    I think this is the subtraction behavior
    var t = parseInt(e.val(), 10) – d;

    and the addition behavior:
    var t = parseInt(e.val(), 10) + d;

    The issue that I think I see is that Mix and Match’s quantity inputs start out empty. This would result in a NaN error for parseInt(e.val()) since you can’t parse a null into an integer. What I would propose here is the you verify there is a value in the input. If not, you can probably assume 0 and calculate from there.

    I think that might help resolve the cross-compatibility issue between our products.

    Please let me know if you have any questions about Mix and Match! Or if I can help in some way to get this resolved.

    #1287708

    Hey Kathy,

    Thanks for contacting us and for your suggestion! I have forwarded your message to our devs and shared this thread as reference. If we have any questions or updates, we will reply to this thread :)

    Best regards,
    Yigit

    #1287768
    Kathy Darling
    Guest

    Thanks Yigit. I’ve had multiple folks come to me with compatibility issues, so it will be great if we can resolve this.

    Perhaps something like:

    
    var t = '' !== e.val() ? parseInt(e.val(), 10) : 0;
    var t = t + d;
    

    Though + d may need to take into account whether the input has reached it’s max attribute.

    #1287883

    Hi Kathy,

    Thanks!

    Our devs have updated /enfold/config-woocommerce/woocommerce-mod.js file and it will be included in upcoming version. I have attached updated version of the file in private content field below. Could you please test it? If you do not mind sending a copy of your plugin, we can gladly test it as well :)

    Best regards,
    Yigit

    #1287884
    Kathy Darling
    Guest

    Hi Yigit,

    Looks very promising, thank you and thanks to the dev team. :) I do not have a copy of your theme so I can’t test it myself, but I’ve sent you the most recent copy of my plugin via wetransfer and you should receive it via your email.

    Cheers!

    -kathy

    #1288314

    Hi Kathy,

    Thanks a lot!

    I received the copy you sent and tried reproducing NaN issue however I could not. I referred to your documentation but I am not sure what I missed. Could you please let me know the steps to reproduce the issue? :)

    I sent you a copy of Enfold with quantity button fix as well.

    Best regards,
    Yigit

    #1288341
    Kathy Darling
    Guest

    Hi Yigit,

    Generally, the issue that is reported to me is that clicking on the plus/minus buttons does not trigger an update to the Mix and Match counter/error notice which is visible just above the add to cart button…. ex: “You have selected 6 items, you must select 12”. It would only say “You have selected 0 items” no matter how many options were selected because it was not detecting any changes.

    Typically that’s the result of the theme script not chaining a .change() event on the quantity input. But as far as I could tell (Again only looking at the minified version) the .change() appeared to be there so the next most likely source of problems was trying to calculate a number based on the null input. I’ve seen that plenty of times too with themes that add their own plus/minus buttons as most assume a number will be there (and for regular add to cart quantity inputs it always is!)

    So if you have the plus/minus buttons correctly triggering updates to the Mix and Match counter, then it sounds like the issue might be resolved? Though there is still the above link that suggests the issue may be related to the built-in script compression. I will try to check later myself, but having a busy day! :)

    cheers,
    -kathy

    #1288344
    Kathy Darling
    Guest

    Ok, figured I’d get testing out of the way first. And definitely seeing the counter not react to the plus/minus buttons:
    Screen Recording 2021-03-15 at 08.42.47.95 AM

    But if i turn off the script compression:
    Image 2021-03-15 at 8.44.19 AM

    Then the counter works:

    So unless you have an idea why the script compression would cause then, I think we’re in an OK state. I will probably still get some users with problems, but know to tell them about the compression thing.

    #1288355

    Hi Kathy,

    Thanks for the info!

    It still does not work when JS file merging and compression is enabled. I have informed our devs who were waiting for the feedback. I will update you once I hear back from them.

    Thanks for your cooperation! :)

    Edit: Thanks for checking! Now we are clear on how to reproduce the issue. Will keep you informed!

    Best regards,
    Yigit

    • This reply was modified 4 years, 2 months ago by Yigit.
Viewing 9 posts - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.