Public Ticket #2848256

PUBLIC TICKET #2725592

Closed
Comments
6 Tickets 3
Nigel started the conversation 5 years ago on August 13, 2021 at 6:37am

I have tried using the snippet 

add_action('woocommerce_login_redirect', function($url){    $url = get_home_url();    // for shop url use $url = get_permalink( wc_get_page_id( 'shop' ) )    return $url;
}

But I get an error message:

The code snippet you are trying to save produced a fatal error on line 6:

syntax error, unexpected end of file, expecting ')'

Can you assist?


2,762
KingsPlugins replied 5 years ago on August 13, 2021 at 1:25pm

Hi Nigel,

Thank you for purchasing the plugin!


That snippet does have an error in it. The correct snippet would be:

add_action('woocommerce_login_redirect', function($url){
    $url = get_home_url(); 
    return $url;
});

The above will redirect users to the HOMEPAGE after they login. Is that what you are trying to achieve?


Kind regards,

Stefan

6 Tickets 3
Nigel replied 5 years ago on August 13, 2021 at 11:39pm

Thank you so much, Stefan

Works perfectly now.
Great support. And I am really happy with the Plugin. Far superior to the previous one I was using.

Nigel

1

Sign In