Viewing 20 posts - 1 through 20 (of 20 total)
  • Author
    Posts
  • #1093778

    I am using the plugin WooCommerce Mix and Match and set it up on a new product but it does not count. Switched theme to twenty sixteen and it counted as it should so now I am reaching out to you to see if you have any thoughts on how to get this working?

    Happy to give you login to take a look.

    #1094013

    Here is what plugin developer says:
    ———————————–
    Thank you for getting in touch. Mix and Match has never had plus/minus buttons for setting the quantity configuration. By default, it uses a simple number input that works pretty universally. The plus/minus buttons are typically added by themes, though it’s possible they are also coming from another plugin. You can confirm this by switching to a default theme and re-testing the Mix and Match product. With so many themes available, there’s no way for me to account for it in the plugin and so the onus is on the users of those themes to make them compatible with MNM.

    The Mix and Match script listens for a change event on the child quantity inputs. jQuery’s change event is only triggered by a manual browser event, and not the programmatic changes causes by clicking the plus and minus buttons. So the solution is to chain a .change() event after the value has been set by whatever “click” script is used by your theme. The tricky part is finding the relevant section of the code.

    As a generic example it may look something like this, look especially closely at the 2nd to last line

    $(‘.quantity’).on(‘click’, ‘.plus’, function(e) {
    $input = $(this).prev(‘input.qty’);
    var val = parseInt($input.val());
    var step = $input.attr(‘step’);
    step = ‘undefined’ !== typeof(step) ? parseInt(step) : 1;
    $input.val( val + step ).change(); // this is the .change() that need to be added!
    });

    The theme developer may know better where this is coming from. I was unable to find it in a brief survey of your source code.
    ———————————–
    Please let me know what you can do to help get this working!

    #1094464

    Could really use some help with this!

    #1094710

    Hi,

    Thank you for using Enfold.

    The theme does add a quantity button to the default product quantity field. You can disable that by editing the config-woocommerce > woocommerce-mod.js file. Look for the “avia_apply_quant_btn” function and comment it out.

    avia_apply_quant_btn();
    
    	//if the cart gets updated via ajax (woocommerce 2.6 and higher) we need to re apply the +/- buttons
    	$( document ).on( 'updated_cart_totals', avia_apply_quant_btn );

    Best regards,
    Ismael

    #1094803

    Thanks for this – is there a way to do it through a child theme?

    #1094815

    I commented out this line but did not seem to make a difference?

    #1094817

    I also tried to comment out the actual call to the function but still showing + / – and did the same for both woocommerce-mod-v26.js and woocommerce-mod.js so now what?

    Thanks for your help!

    #1094961

    Hi,
    Please include FTP access in the Private Content area so we can assist.

    Best regards,
    Mike

    #1094978

    THANK YOU!

    #1094980

    Hi,
    I commented out the function avia_apply_quant_btn, but I believe your merged js is still showing it, please disable your performance js & css merging, or Please include an admin login in the Private Content area.

    Best regards,
    Mike

    #1094981

    I’m on my way out the door so am going to give you access.

    #1094988

    Hi,
    Thank you, turning off the merged js and then turning back on seemed to have solved it. Please check when you get a chance.

    Best regards,
    Mike

    #1095317

    Great all seems to be working now. THANKS SO MUCH. One more question. Will I need to update this with an Enfold theme update or is there a way to make this permanent?

    #1096053

    Hi,

    Thanks for the update.

    We’re not really sure how the scripts affect the plugin, but maybe you can just leave the theme’s script as is and then use the following css code to hide the quantity buttons.

    #top div .quantity input.plus, #top div .quantity input.minus {
        display: none !important;
    }

    If this doesn’t work, you may need to copy the woocommerce-mod.js file in your child theme, register it as a new script and deregister the original file.

    // https://codex.wordpress.org/Function_Reference/wp_deregister_script

    Best regards,
    Ismael

    #1096191

    Moving the script is a good idea I will look at that – THANKS

    #1096326

    Hi,
    Glad Ismael could help, please let us know if there is anything else we can help with.

    Best regards,
    Mike

    #1108242

    Hi,

    I have the same issue but have found that all I need to do to fix the issue is to Disable Javascript file merging and compression under performance.

    No other changes were required. Enabling this again breaks the plugin.

    #1108358

    Hi,
    Please try checking the checkbox at the very bottom of the performance page that says “Delete old CSS and JS files?” and save the settings. Then go to your Quick CSS and add a blank space and save, then go back to your performance page and try enable the merging again.
    This assumes there is an error in your merged files and we want to rebuild them.
    Another possibility is that you have another plugin that is minifying the files a second time causing errors. Autoptimize does this sometimes, among others.

    Best regards,
    Mike

    #1108790

    Hi Mike,

    I ran through what you suggested but it hasn’t made any difference and I am not using a caching plugin.

    #1108965

    Hi,

    You should try another compression plugin like Autoptimize instead of using the option in the theme.

    // https://wordpress.org/plugins/autoptimize/

    Let us know if it helps. Please open a new thread if it doesn’t make any difference. We’ll close this thread now.

    Best regards,
    Ismael

Viewing 20 posts - 1 through 20 (of 20 total)
  • The topic ‘Mix and Match does not count with Enfold theme’ is closed to new replies.