Site icon Experience Wordpress Developer Online – Design Develop and Maintenance Support

Woocommerce Add To Cart Button Redirect To Cart Page

Now, I discuss how to Add To Cart Button Redirect To Cart Page in Woocommerce. To do so please add the following line of code at the end of your theme’s functions.php file of your active child theme (or theme) and Save the file.

add_filter ('add_to_cart_redirect', 'redirect_to_cart');
function redirect_to_cart() {
    global $woocommerce;
    $cart_url = $woocommerce->cart->get_cart_url();
    return $cart_url;
}
Exit mobile version