Home › Forums › WoodMart support forum › Add to cart button stuck and keeps on loading
Add to cart button stuck and keeps on loading
- This topic has 14 replies, 2 voices, and was last updated 2 years ago by Artem Temos.
-
AuthorPosts
-
December 7, 2022 at 11:47 am #426931
danialarif58ParticipantAdd to cart button stuck and keeps on loading on product page.
website is: https://www.moajbazar.comkindly check shop page and let me know what could be the reason for this.
December 7, 2022 at 12:27 pm #426945
Artem TemosKeymasterHello,
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
December 7, 2022 at 12:30 pm #426947
danialarif58ParticipantYes please check the theme, i have already de activated all 3rd party plugins
December 7, 2022 at 12:50 pm #426957
Artem TemosKeymasterTry 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
December 7, 2022 at 12:56 pm #426962
danialarif58ParticipantMy website crashed due to your code. kindly help me!
Attachments:
You must be logged in to view attached files.December 7, 2022 at 12:58 pm #426966
Artem TemosKeymasterPlease, send us your FTP access so we can check what is wrong.
Kind Regards
December 7, 2022 at 1:01 pm #426980
danialarif58ParticipantGuide me how to send you FTP Access? do you need hosting access?
December 7, 2022 at 1:28 pm #427000
danialarif58ParticipantI have regained the access kindly check it again your code is not solving my problems
December 7, 2022 at 1:29 pm #427001
Artem TemosKeymasterWe don’t see the child theme installed on your website. Also, you need to have the latest version of the theme.
December 7, 2022 at 1:35 pm #427003
danialarif58ParticipantI have installed child theme now and updated Parent theme!
December 7, 2022 at 1:38 pm #427006
danialarif58ParticipantCan I add the PHP snippet into child theme function.php?
December 7, 2022 at 1:44 pm #427007
danialarif58ParticipantI 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);December 7, 2022 at 1:54 pm #427012
Artem TemosKeymasterTry 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
December 7, 2022 at 1:58 pm #427013
danialarif58Participantit agains giving the error
December 7, 2022 at 3:37 pm #427040
Artem TemosKeymasterIt 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
-
AuthorPosts
Tagged: Add to cart button issue
- You must be logged in to create new topics. Login / Register