Home Forums WoodMart support forum How can i redirect the user in other url when he click create an accound

How can i redirect the user in other url when he click create an accound

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #335822

    erimusa11
    Participant

    I have done an other register form other one in other page but i want change the redirect link when the user goes click ” create an accound ” here https://prnt.sc/213kns0 how can i do it so i can add the new page of registration ?

    #335875

    Luke Nielsen
    Keymaster

    Hello,

    To be able to change the redirect link, try to add this code to the functions.php file in your child theme. Insert your link into the value of the “$account_link” variable.

    https://monosnap.com/file/rnZWy1Y1bVhoMrExB0VcE1vJcXo607

    if ( ! function_exists( 'woodmart_sidebar_login_form' ) ) {
        function woodmart_sidebar_login_form() {
            if ( ! woodmart_woocommerce_installed() ) {
                return;
            }
    
            $settings     = whb_get_settings();
            $login_side   = isset( $settings['account'] ) && $settings['account']['login_dropdown'] && $settings['account']['form_display'] == 'side';
            $account_link = ' Enter your link here. ';
            $page_id      = woodmart_get_the_ID() ? woodmart_get_the_ID() : get_option( 'woocommerce_myaccount_page_id' );
            $redirect_url = apply_filters( 'woodmart_my_account_side_login_form_redirect', get_permalink( $page_id ) );
    
            $wrapper_classes = '';
    
            if ( 'light' === whb_get_dropdowns_color() ) {
                $wrapper_classes .= ' color-scheme-light';
            }
    
            $position = is_rtl() ? 'left' : 'right';
    
            $wrapper_classes .= ' wd-' . $position;
    
            if ( ! $login_side || is_user_logged_in() ) {
                return;
            }
    
            woodmart_enqueue_inline_style( 'header-my-account-sidebar' );
    
            ?>
            <div class="login-form-side wd-side-hidden<?php echo esc_attr( $wrapper_classes ); ?>">
                <div class="widget-heading">
                    <h3 class="widget-title"><?php esc_html_e( 'Sign in', 'woodmart' ); ?></h3>
                    <div class="close-side-widget wd-action-btn wd-style-text wd-cross-icon">
                        <a href="#" rel="nofollow"><?php esc_html_e( 'close', 'woodmart' ); ?></a>
                    </div>
                </div>
    
                <?php woocommerce_output_all_notices(); ?>
    
                <?php woodmart_login_form( true, $redirect_url, false, true, $redirect_url ); ?>
    
                <div class="create-account-question">
                    <p><?php esc_html_e( 'No account yet?', 'woodmart' ); ?></p>
                    <a href="<?php echo esc_url( add_query_arg( 'action', 'register', $account_link ) ); ?>" class="btn btn-style-link btn-color-primary create-account-button"><?php esc_html_e( 'Create an Account', 'woodmart' ); ?></a>
                </div>
            </div>
            <?php
        }
    
        add_action( 'woodmart_before_wp_footer', 'woodmart_sidebar_login_form', 160 );
    }

    Kind Regards

    #336165

    erimusa11
    Participant

    thank you it helped allot

    #336225

    Luke Nielsen
    Keymaster

    Hello,

    You are welcome!

    Let us know if there’s anything else we can do for you! You can always reach us at any time.

    Wish you a wonderful day!

    Kind Regards

Viewing 4 posts - 1 through 4 (of 4 total)

The topic ‘How can i redirect the user in other url when he click create an accound’ is closed to new replies.