Home › Forums › WoodMart support forum › Add to cart button in single producto page › Reply To: Add to cart button in single producto page
ernesto-8220
Hi 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);