-
AuthorPosts
-
July 22, 2016 at 9:16 pm #664077
Hello, we are having issues with the WooCommerce Measurement Price Calculator with the Enfold theme, this just started happening about a week ago. When someone tries to add a product to the cart this error message comes up “Please match the requested format:Qty.” I have tested the plugins with Twenty Sixteen and it works. This is an urgent issue as our client is loosing sales, your help is greatly appreciated. You guys are the best!
Thank you,
ChrisJuly 25, 2016 at 7:59 pm #664792Hello, if someone could please look into this that would be great. Not sure how the ticket system works, but there are a lot of replies on things from today while I have put this request in on Friday of last week. Its very important that I get this figured out for my client as they are loosing sales. If you guys are already looking into this, please just shoot an email letting me know the status.
Thank you!
ChrisJuly 26, 2016 at 12:10 am #664965Hi,
Open
/config-woocommerce/woocommerce-mod.js
and remove this:jQuery(".quantity input[type=number]").each(function() { var number = $(this), max = parseFloat( number.attr( 'max' ) ), min = parseFloat( number.attr( 'min' ) ), step = parseInt( number.attr( 'step' ), 10 ), newNum = jQuery(jQuery(' <div />').append(number.clone(true)).html().replace('number','text')).insertAfter(number); number.remove(); setTimeout(function(){ if(newNum.next('.plus').length == 0) { var minus = jQuery('<input type="button" value="-" class="minus">').insertBefore(newNum), plus = jQuery('<input type="button" value="+" class="plus">').insertAfter(newNum); minus.on('click', function(){ var the_val = parseInt( newNum.val(), 10 ) - step; the_val = the_val < 0 ? 0 : the_val; the_val = the_val < min ? min : the_val; newNum.val(the_val); }); plus.on('click', function(){ var the_val = parseInt( newNum.val(), 10 ) + step; the_val = the_val > max ? max : the_val; newNum.val(the_val); }); } },10); });
Best regards,
JosueJuly 26, 2016 at 3:31 pm #665362Hi Josue,
Thank you so much, everything works great again! One last question, will this fix be included in the next version of Enfold or do I need to replace it with the next theme update?
Thank you!
ChrisJuly 27, 2016 at 3:03 am #665565Hi,
You’d need to do this on each update, either that or remove the .js file completely (via child theme):
function dequeue_modjs() { wp_dequeue_script( 'avia-woocommerce-js' ); } add_action( 'wp_enqueue_scripts', 'dequeue_modjs', 100 );
Best regards,
JosueJuly 27, 2016 at 3:35 pm #665792So I just add your code to my child themes functions.php?
July 28, 2016 at 8:41 am #666081Yes but that will remove all JS WooCommerce modifications made by Enfold (like the add to cart ajax functionality).
Best regards,
JosueAugust 1, 2016 at 3:27 pm #667317Ok, so i’m a little confused. So if I add your code to my functions file, will it mess with other things besides what I’m trying to fix? I would like to get this so no files need to be replaced after an enfold update.
Thank you,
ChrisAugust 4, 2016 at 12:17 am #668318Hi,
Found another way:
add_action('init', function() { wp_dequeue_script( 'avia-woocommerce-js' ); wp_enqueue_script( 'avia-woocommerce-child-js', get_stylesheet_directory_uri().'/js/woocommerce-mod.js', array('jquery'), 2, true ); });
Use that code in your child theme
functions.php
and clonewoocommerce-mod.js
to it, that way you can have your own version of the file and still preserve the other Enfold WC modifications.Best regards,
Josue- This reply was modified 8 years, 4 months ago by Josue.
August 4, 2016 at 2:59 pm #668604Hi Josue!
So when you say clone woocommerce-mod.js to it, does that mean add all of the code in woocommerce-mod.js to the funtions file after the
add_action(‘init’, function() {
wp_dequeue_script( ‘avia-woocommerce-js’ );
wp_enqueue_script( ‘avia-woocommerce-child-js’, get_stylesheet_directory_uri().’/js/woocommerce-mod.js’, array(‘jquery’), 2, true );
});Or do I add woocommerce-mod.js to my child theme?
Thank you,
ChrisAugust 5, 2016 at 3:13 am #668781Hi,
The second, copy
woocommerce-mod.js
to a folder namedjs
in your child theme,Best regards,
JosueAugust 5, 2016 at 8:05 pm #669113Hi Josue,
I added the edited woocommerce-mod.js into a js folder in the child theme and added the code to my child theme function.php and it didn’t work, had to replace the one in the theme again after update. So right now the child theme still has the function setup with the code you gave me and the js folder with the edited woocommerce-mod.js file. I had to replace the one in the main theme for now so the store works, but if you have time to look into this I’ve added FTP credentials.
Thank you,
ChrisAugust 7, 2016 at 3:45 pm #669460Hi,
Problem is the parent woocommmerce-mod-js is not being excluded, it seems there’s some sort of caching on your site because i even tried removing it from
/config-woocommerce/config.php
and didn’t have effect.Best regards,
JosueAugust 8, 2016 at 3:55 pm #669875We use WP Engine for hosting, everything is cached. Just let me know what I need to remove caching from and I’ll call my host.
Thank you!
ChrisAugust 8, 2016 at 4:50 pm #669919Nothing really, i missed something in my code, here’s the final one that works:
add_action('init', function() { wp_dequeue_script( 'avia-woocommerce-js' ); wp_enqueue_script( 'avia-woocommerce-child-js', get_stylesheet_directory_uri().'/js/woocommerce-mod.js', array('jquery'), 2, true ); }, 11, 1);
Missed that
11
priority parameter so it runs after the parent one hook and dequeues avia-woocommerce-js.Best regards,
JosueAugust 8, 2016 at 5:29 pm #669947Success!!! Nice work Josue! I appreciate you time and effort on this. Enfold is the number one theme we use and this is why, a beautiful solid theme with a dedicated and knowledgeable support staff. You guys are the best! Consider this topic closed.
Thank you!
ChrisAugust 8, 2016 at 5:55 pm #669962You are welcome, glad to help :)
Regards,
Josue -
AuthorPosts
- The topic ‘Conflict between WooCommerce Measurement Price Calculator and Enfold’ is closed to new replies.