Home Forums WoodMart support forum Add to Card is too slow

Add to Card is too slow

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #315241

    tohama
    Participant

    Add an item to Cart is taking over 15 seconds , i just installed my theme

    #315262

    tohama
    Participant

    The Default Demo theme after installation has i bug you can see it in the photos i left here ,
    can i give an access to the Admin Panel and get al these fixed

    Attachments:
    You must be logged in to view attached files.
    #315281

    Artem Temos
    Keymaster

    Hello,

    Could you please check how it works with some default WordPress themes like TwentyTwenty or WooCommerce Storefront to understand is it our theme issue or not?

    Regards

    #315458

    tohama
    Participant

    I tried a different theme and it is a little bit faster ,
    what can i do now ?

    #315461

    Artem Temos
    Keymaster

    Could you please disable these plugins on your server temporarily https://gyazo.com/86cd4ad9a92a24e7f451c0b7a57a778b ?
    Also, send us your FTP access.

    #315482

    tohama
    Participant

    I didnt install those plugins at all from the begin (SSO and Enhanced Page Cache ).

    #315541

    tohama
    Participant

    Also the Site Speed on Develper.google.come
    36 on mobile
    49 on desktop
    this is not acceptable at all , the theme description Says that the theme is optimized for google page speed , I see No Performance

    Attachments:
    You must be logged in to view attached files.
    #315614

    Artem Temos
    Keymaster

    Try to add the following PHP code snippet to the child theme functions.php file to fix this

    add_filter( 'woocommerce_add_to_cart_fragments', 'woodmart_cart_data', 30 );
    function woodmart_cart_data( $array ) {
    	ob_start();
    	woodmart_cart_count();
    	$count = ob_get_clean();
    
    	ob_start();
    	woodmart_cart_subtotal();
    	$subtotal = ob_get_clean();
    
    	$array['span.wd-cart-number_wd']   = $count;
    	$array['span.wd-cart-subtotal_wd'] = $subtotal;
    
    	return $array;
    }

    and put the following code to the Custom JS in Theme Settings

    jQuery( document.body ).on( 'added_to_cart removed_from_cart', function( e, fragments ){
    	if ( fragments ) {
    			jQuery.each( fragments, function( key, value ) {
    				jQuery( key.replace('_wd','') ).replaceWith( value );
    			});
    
    			jQuery( document.body ).trigger( 'wc_fragments_loaded' );
    		}
    });

    Then clear your browser cache and check the add to cart speed.

Viewing 8 posts - 1 through 8 (of 8 total)