This topic has 6 replies, 3 voices, and was last updated 9 years, 4 months ago ago by Eva Kemp
Hello, i would like to, when the client click to buy, he be directly to checkout page and don’t just atualize de basquet, but change the page to checkout. There, he can decide if finish the buy our continues buying
Hello,
If you need to redirect the user directly to the checkout page instead of the current product page or cart page, put this snippet to your Child theme functions.php file.
/**
* Redirect user to checkout page directly after adding to cart
*
* @return string
*/
function wc_redirect_to_checkout() {
$checkout_url = WC()->cart->get_checkout_url();
return $checkout_url;
}
add_filter( 'woocommerce_add_to_cart_redirect', 'wc_redirect_to_checkout' );
Regards,
Robert Hall.
I’m sorry to tell you that doesen’t work.
Hello,
You didn’t create the Child Theme.
Please provide us with FTP credentials in Private Content.
Regards,
Robert Hall.
I don’t know what is, our how to create a child theme.
Hello,
I’ve created a child theme and added the code in functions.php file in the directory wp-content/themes/royal-child. Please clear browser cache and check products now.
Regards,
Eva Kemp.
You must be logged in to reply to this topic.Log in/Sign up