Viewing 17 posts - 1 through 17 (of 17 total)
  • Author
    Posts
  • #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,
    Chris

    #664792

    Hello, 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!
    Chris

    #664965

    Hi,

    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,
    Josue

    #665362

    Hi 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!
    Chris

    #665565

    Hi,

    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,
    Josue

    #665792

    So I just add your code to my child themes functions.php?

    #666081

    Yes but that will remove all JS WooCommerce modifications made by Enfold (like the add to cart ajax functionality).

    Best regards,
    Josue

    #667317

    Ok, 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,
    Chris

    #668318

    Hi,

    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 clone woocommerce-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.
    #668604

    Hi 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,
    Chris

    #668781

    Hi,

    The second, copy woocommerce-mod.js to a folder named js in your child theme,

    Best regards,
    Josue

    #669113

    Hi 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,
    Chris

    #669460

    Hi,

    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,
    Josue

    #669875

    We 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!
    Chris

    #669919

    Nothing 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,
    Josue

    #669947

    Success!!! 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!
    Chris

    #669962

    You are welcome, glad to help :)

    Regards,
    Josue

Viewing 17 posts - 1 through 17 (of 17 total)
  • The topic ‘Conflict between WooCommerce Measurement Price Calculator and Enfold’ is closed to new replies.