Home Forums WoodMart support forum Add to cart button loading items to cart very very very slow or not at all

Add to cart button loading items to cart very very very slow or not at all

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #448073

    eco
    Participant

    Good day
    I have had an issue with my woodmart child theme since the last update. Very frustrating as my site has been unusable for a long time, clients cannot add products to the cart so who knows how many sales have been lost while I track contact with anyone who can assist me. Really really frustrating.
    Please could someone from tech support assist me ASAP
    Regards

    #448089

    Artem Temos
    Keymaster

    Hello,

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

    add_filter('woocommerce_add_to_cart_redirect', function( $url ) {
    	if( strpos( $url, 'product-added-to-cart' ) > 0 || strpos( $url, 'product_added_to_cart' ) > 0) {
    		if ( isset( $_REQUEST['wd-add-to-cart'] ) ) {
    			return wc_get_checkout_url();
    		}
    		return '';
    	} 
    	return $url;
     }, PHP_INT_MAX);

    Kind Regards

    #448095

    eco
    Participant

    OK thanks we will try
    Also the homepage is loading very slowly since the update. The other pages are fine but the homepage is loading very slowly

    #448114

    eco
    Participant

    Will this be resolved with teh next theme update so we can remove the code

    #448540

    Artem Temos
    Keymaster

    Hello,

    The add to cart problem is caused by one of the installed plugins. So you need to keep the code even after the update.

    As for the home page, please, check how it works with the default WordPress theme to see if it is caused by WoodMart or not.

    Thank you in advance.

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