Home › Forums › WoodMart support forum › Add to cart button in single producto page
Add to cart button in single producto page
- This topic has 5 replies, 2 voices, and was last updated 2 years ago by
Luke Nielsen.
-
AuthorPosts
-
April 29, 2023 at 3:57 am #463121
ernesto-8220ParticipantHi im having trouble in the single product page, when i click ont he add to cart button it just keeps loading and nothing happens, just if i refresh the page then is added but the lateral panel does not opens nor the popup cart , if a deactivate the ajax button then it works the message is placed up like a woocommerce notice , but i want to show in the lateral panel when it clicks or a pop up .
Attachments:
You must be logged in to view attached files.May 1, 2023 at 12:56 pm #463500
Luke NielsenKeymasterHello,
Please deactivate all plugins except these ones:
WPBakery Page Builder or Elementor
Woodmart Core
WooCommerce
Please switch to the parent theme if you use the child.If the problem has gone, activate the plugins one by one, checking the issue to detect which one causes the problem.
If the issue still persists, please confirm the permission for the plugin’s deactivation, switching to the parent theme. As soon as we complete the testing we will enable all back.
Kind Regards
May 8, 2023 at 9:02 pm #465423
ernesto-8220ParticipantHi i tried the deactivation of the plugins but still nothing, what i did is paste a code that i found in the forum that i will paste in the end of this message it says that it should be paste on the functions.php file , and it worked but with every actualization it is erased, i tried a code snippet plugin but none seems to work , you have permission to deactivate the necessary plugins thank you
this is the code that i pasted in function.php
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);May 9, 2023 at 4:31 pm #465672
Luke NielsenKeymasterHello,
Ok, but firstly could you please update the access? Because seems that the earlier provided is not available: https://take.ms/uUHqs
Thanks for your time and have a great day.
Kind Regards
May 9, 2023 at 8:29 pm #465717
ernesto-8220Participantim sorry my mistake here are again
May 10, 2023 at 2:13 pm #465891
Luke NielsenKeymasterHello,
First of all, you should create a child theme and then in the functions.php file in your child theme define the above code. So as a result it will not disappear after updating the theme and the button will work well.
Don’t hesitate to let me know if you need any further help or any other info.
Kind Regards
-
AuthorPosts
- You must be logged in to create new topics. Login / Register