-
AuthorPosts
-
April 24, 2019 at 12:39 am #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.
April 24, 2019 at 3:22 pm #1094013Here 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!April 25, 2019 at 5:16 pm #1094464Could really use some help with this!
April 26, 2019 at 12:42 pm #1094710Hi,
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,
IsmaelApril 26, 2019 at 6:01 pm #1094803Thanks for this – is there a way to do it through a child theme?
April 26, 2019 at 6:29 pm #1094815I commented out this line but did not seem to make a difference?
April 26, 2019 at 6:36 pm #1094817I 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!
April 27, 2019 at 8:50 pm #1094961Hi,
Please include FTP access in the Private Content area so we can assist.Best regards,
MikeApril 27, 2019 at 10:51 pm #1094978THANK YOU!
April 27, 2019 at 11:15 pm #1094980Hi,
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,
MikeApril 27, 2019 at 11:21 pm #1094981I’m on my way out the door so am going to give you access.
April 27, 2019 at 11:37 pm #1094988Hi,
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,
MikeApril 29, 2019 at 3:46 pm #1095317Great 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?
May 1, 2019 at 7:40 am #1096053Hi,
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,
IsmaelMay 1, 2019 at 3:25 pm #1096191Moving the script is a good idea I will look at that – THANKS
May 2, 2019 at 5:33 am #1096326Hi,
Glad Ismael could help, please let us know if there is anything else we can help with.Best regards,
MikeJune 7, 2019 at 12:02 pm #1108242Hi,
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.
June 8, 2019 at 3:09 am #1108358Hi,
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,
MikeJune 10, 2019 at 11:53 am #1108790Hi Mike,
I ran through what you suggested but it hasn’t made any difference and I am not using a caching plugin.
June 11, 2019 at 3:40 am #1108965Hi,
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 -
AuthorPosts
- The topic ‘Mix and Match does not count with Enfold theme’ is closed to new replies.