Your account expired support, please renew to get your support.

HomePage Forums Themes Support Freshio – Organic & Food Store WordPress Theme How to edit login/register default form ?

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #21392
    gowebs
    Support Expired

    Hi,

    i want to edit form field default for reg/login. Please how can i do that ?

    Thank you

    #21410
    gowebs
    Support Expired

    i want edit this dropdown login / register.

    this default : https://nimb.ws/1heFAO

    to : https://nimb.ws/rb7YVU

    how can i do that.

    #21435

    Hi you,

    To edit this form login, please copy this function and paste to file functions.php ( child-theme), then edit:

    function freshio_form_login()
    	{
    
            if (freshio_is_woocommerce_activated()) {
                $account_link = get_permalink(get_option('woocommerce_myaccount_page_id'));
            } else {
                $account_link = wp_registration_url();
            }
        ?>
    
    		<div class="login-form-head">
    			<span class="login-form-title"><?php esc_attr_e('Sign in', 'freshio') ?></span>
    			<span class="pull-right">
                    <a class="register-link" href="<?php echo esc_url($account_link); ?>"
    				   title="<?php esc_attr_e('Register', 'freshio'); ?>"><?php esc_attr_e('Create an Account', 'freshio'); ?></a>
                </span>
    		</div>
    		<form class="freshio-login-form-ajax" data-toggle="validator">
    			<p>
    				<label><?php esc_attr_e('Username or email', 'freshio'); ?> <span class="required">*</span></label>
    				<input name="username" type="text" required placeholder="<?php esc_attr_e('Username', 'freshio') ?>">
    			</p>
    			<p>
    				<label><?php esc_attr_e('Password', 'freshio'); ?> <span class="required">*</span></label>
    				<input name="password" type="password" required
    					   placeholder="<?php esc_attr_e('Password', 'freshio') ?>">
    			</p>
    			<button type="submit" data-button-action
    					class="btn btn-primary btn-block w-100 mt-1"><?php esc_html_e('Login', 'freshio') ?></button>
    			<input type="hidden" name="action" value="freshio_login">
    			<?php wp_nonce_field('ajax-freshio-login-nonce', 'security-login'); ?>
    		</form>
    //Add shortcode Captcha
    		<div class="login-form-bottom">
    			<a href="<?php echo wp_lostpassword_url(get_permalink()); ?>" class="lostpass-link"
    			   title="<?php esc_attr_e('Lost your password?', 'freshio'); ?>"><?php esc_attr_e('Lost your password?', 'freshio'); ?></a>
    		</div>
    		<?php
    	}
    #21450
    gowebs
    Support Expired

    Hi,

    how can edit code

    …..
    } else {
    $account_link = wp_registration_url();

    ….

    change to direct link go to register page, like “my account” in footer bar (mobile version).

    • This reply was modified 2 years, 1 month ago by gowebs.
    #21455

    You can edit code:

    $account_link = 'your-link';

    #21457
    gowebs
    Support Expired

    it’s not work, how can edit button to direct link or popup (not login/reg) without dropdown like footer bar button for “my account”.

    #21458
    gowebs
    Support Expired
    This reply has been marked as private.
    #21483

    Hi,
    You need to overwrite main.js file to remove this js dropdown:

    Copy this code to file functions.php:

    add_action( 'after_setup_theme', 'freshio_fnc_custom_script' );
    function freshio_fnc_custom_script() {
        add_action('wp_enqueue_scripts','freshio_register_scripts_custom');
    }
    
    function freshio_register_scripts_custom(){
        wp_dequeue_script( 'freshio-theme' );
        wp_deregister_script( 'freshio-theme' );
        wp_enqueue_script( 'custom-freshio-theme', get_stylesheet_directory_uri() . '/main.js' );
    }

    Then copy the file themes/freshio/assets/js/frontend/main.js and paste to child-tehme

    Edit file main.js: https://ibb.co/ZdpPyLK

    #21446
    gowebs
    Support Expired
    This reply has been marked as private.
    #21549

    Please copy this code to file functions.php ( child-theme):

    function freshio_form_login()
    	{
    
            if (freshio_is_woocommerce_activated()) {
                $account_link = get_permalink(get_option('woocommerce_myaccount_page_id'));
            } else {
                $account_link = wp_registration_url();
            }
        ?>
    
    		<div class="login-form-head">
    			<span class="login-form-title"><?php esc_attr_e('Sign in', 'freshio') ?></span>
    			<span class="pull-right">
                    <a class="register-link" href="<?php echo esc_url($account_link); ?>"
    				   title="<?php esc_attr_e('Register', 'freshio'); ?>"><?php esc_attr_e('Create an Account', 'freshio'); ?></a>
                </span>
    		</div>
    		<form class="woocommerce-form woocommerce-form-login login" method="post">
    
    			<?php do_action( 'woocommerce_login_form_start' ); ?>
                <div class="woocommerce-form-login-wrap">
                    <h2 class="login-form-title"><?php esc_html_e( 'Login', 'woocommerce' ); ?></h2>
                    <p class="woocommerce-form-row woocommerce-form-row--wide form-row form-row-wide">
                        <label for="username"><?php esc_html_e( 'Username or email address', 'woocommerce' ); ?>
                            &nbsp;<span class="required">*</span></label>
                        <input type="text" class="woocommerce-Input woocommerce-Input--text input-text" name="username" id="username" autocomplete="username" value="<?php echo ( ! empty( $_POST['username'] ) ) ? esc_attr( wp_unslash( $_POST['username'] ) ) : ''; ?>"/><?php // @codingStandardsIgnoreLine ?>
                    </p>
                    <p class="woocommerce-form-row woocommerce-form-row--wide form-row form-row-wide">
                        <label for="password"><?php esc_html_e( 'Password', 'woocommerce' ); ?>
                            &nbsp;<span class="required">*</span></label>
                        <input class="woocommerce-Input woocommerce-Input--text input-text" type="password" name="password" id="password" autocomplete="current-password"/>
                    </p>
    				<?php do_action( 'woocommerce_login_form' ); ?>
                    <button type="submit" class="woocommerce-button button woocommerce-form-login__submit" name="login" value="<?php esc_attr_e( 'Log in', 'woocommerce' ); ?>"><?php esc_html_e( 'Log in', 'woocommerce' ); ?></button>
                </div>
    
                <label class="woocommerce-form__label woocommerce-form__label-for-checkbox woocommerce-form-login__rememberme">
                    <input class="woocommerce-form__input woocommerce-form__input-checkbox" name="rememberme" type="checkbox" id="rememberme" value="forever"/>
                    <span><?php esc_html_e( 'Remember me', 'woocommerce' ); ?></span>
                </label>
    			<?php wp_nonce_field( 'woocommerce-login', 'woocommerce-login-nonce' ); ?>
    
                <p class="woocommerce-LostPassword lost_password">
                    <a href="<?php echo esc_url( wp_lostpassword_url() ); ?>"><?php esc_html_e( 'Lost your password?', 'woocommerce' ); ?></a>
                </p>
    
    			<?php do_action( 'woocommerce_login_form_end' ); ?>
    
            </form>
    		
    		<?php
    	}
Viewing 10 posts - 1 through 10 (of 10 total)

You must be logged in to reply to this topic.