Problem in add to card button
-
Hello I am trying to redirect the button add to card to an external website , so I add this part of code in functions.php :
/**
* Redirect users after add to cart.
*/
function my_custom_add_to_cart_redirect( $url ) {
$url = ‘https://www.google.com’; // Replace with your desired external URL
return $url;
}
add_filter( ‘woocommerce_add_to_cart_redirect’, ‘my_custom_add_to_cart_redirect’ );but it’s redirecting me to this :
https://merchbyamz.de/wp-login.php?redirect_to=httpsmerchbyamz.dewp-admin&reauth=1What could be the problem please?
WP.com: Yes
Jetpack: Yes
Correct account: YesThe blog I need help with is: (visible only to moderators and staff)
-
Hi there!
You may want to post this on the WooCommerce support forum here: https://wordpress.org/support/plugin/woocommerce/
On this forum, we can help with WordPress.com sites. Since your question is specific to WooCommerce, please post on the link above so that you can get help directly from the WooCommerce support team.
Thanks!
- The topic ‘Problem in add to card button’ is closed to new replies.