Pages

Friday, March 8, 2013

woocommerce redirect user to cart page after click on add to cart



Please write this code in functions.php file in wordpress theme

add_filter('add_to_cart_redirect', 'custom_add_to_cart_redirect');

function custom_add_to_cart_redirect() {
     return get_permalink(get_option('woocommerce_cart_page_id')); // Replace with the url of your choosing
}

No comments: