Login redirecting on different pages in my Woocommerce theme

1

I'm developing my own Woocommerce theme, and now I need to make a redirect after logging in to a particular page where I'm using the Woocommerce login form.

For this I have added the following function in functions.php


if (!is_account_page()) {
    add_filter('woocommerce_login_redirect', 'redirect_after_login_cart');
    function redirect_after_login_cart(){
        wp_redirect( get_permalink( get_page_by_path('finalizar-compra') ) );
        exit;
    }
}

I want only the login-cart page to redirect after login to the finalize-buy page. The my-account form continues to redirect to my-account page. As it stands, all my Woocommerce login forms are redirecting to the finalize-buy page. The conditional is not being respected.

If anyone can help me, I'll be very grateful.

    
asked by anonymous 13.05.2016 / 03:47

0 answers