Home Forums WoodMart support forum Add to cart button stuck and keeps on loading

Add to cart button stuck and keeps on loading

Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
    Posts
  • #426931

    danialarif58
    Participant

    Add to cart button stuck and keeps on loading on product page.
    website is: https://www.moajbazar.com

    kindly check shop page and let me know what could be the reason for this.

    #426945

    Artem Temos
    Keymaster

    Hello,

    Could you please disable all plugins that are not related to our theme and provide us your admin access so we can check it?

    Thank you in advance

    #426947

    danialarif58
    Participant

    Yes please check the theme, i have already de activated all 3rd party plugins

    #426957

    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_redirect', function( $url ) {
    	if( strpos( $url, 'product-added-to-cart' ) > 0) {
    		return '';
    	} 
    	return $url;
     }, PHP_INT_MAX);

    Kind Regards

    #426962

    danialarif58
    Participant

    My website crashed due to your code. kindly help me!

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

    Artem Temos
    Keymaster

    Please, send us your FTP access so we can check what is wrong.

    Kind Regards

    #426980

    danialarif58
    Participant

    Guide me how to send you FTP Access? do you need hosting access?

    #427000

    danialarif58
    Participant

    I have regained the access kindly check it again your code is not solving my problems

    #427001

    Artem Temos
    Keymaster

    We don’t see the child theme installed on your website. Also, you need to have the latest version of the theme.

    #427003

    danialarif58
    Participant

    I have installed child theme now and updated Parent theme!

    #427006

    danialarif58
    Participant

    Can I add the PHP snippet into child theme function.php?

    #427007

    danialarif58
    Participant

    I have added the following PHP code snippet to the child theme’s functions.php file. But it is not fixing my problem of Add to cart button keeps on loading on product page.

    add_filter(‘woocommerce_add_to_cart_redirect’, function( $url ) {
    if( strpos( $url, ‘product-added-to-cart’ ) > 0) {
    return ”;
    }
    return $url;
    }, PHP_INT_MAX);

    #427012

    Artem Temos
    Keymaster

    Try to replace the code with this one

    add_filter('woocommerce_add_to_cart_redirect', function( $url ) {
    	if( strpos( $url, 'product-added-to-cart' ) > 0 || strpos( $url, 'product_added_to_cart' ) > 0) {
    		return '';
    	} 
    	return $url;
     }, PHP_INT_MAX);

    Kind Regards

    #427013

    danialarif58
    Participant

    it agains giving the error

    #427040

    Artem Temos
    Keymaster

    It looks like you copied a code and missed some symbols. Make sure that you copy the exact same code from the forum topic. Send us a screenshot when you put it into the functions.php file.

    Kind Regards

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