Rahmon / woo-for-logged-users

Set WooCommerce pages accessible only for logged-in users
GNU General Public License v2.0
3 stars 1 forks source link

After login - redirect to specific page #36

Open steve-exotic opened 1 week ago

steve-exotic commented 1 week ago

![Uploading Scherm­afbeelding 2024-10-15 om 19.56.30.png…]() Dear sir,

When i want to switch the page where the client goes after login, i'd love that to be the shop page. Unfortunately it shows alot of pages, but not our shop page (https://dessertdirect.nl/shop/).

Any solution for that in the works, or am i missing something here? Sorry for the inconvenience, love the plugin! Thanks alot!

Cheers, Steve (if possible, reply at our work email -> info@cvk-design.nl)

Rahmon commented 1 week ago

Hi @steve-exotic

You can use the filter wflu_redirect_after_login_page_url to bypass the setting and add your custom logic.

Example (you can add it to the functions.php file of your theme):

add_filter(
    'wflu_redirect_after_login_page_url',
    function( $redirect_to ) {
        $shop_page_link = get_permalink( wc_get_page_id( 'shop' ) );

        if ( empty( $shop_page_link ) ) {
            return $redirect_to;
        }

        return $shop_page_link;
    }
);