This topic contains 3 reply and 2 voices, and was last updated by Nayem 4 years, 6 months ago
Viewing 3 Posts - 1 through 3 (of 3 total)
Author Posts
February 20, 2015 at 11:42 pm 37255
Nayem Hello wedev team, Happy 21st February national language day! During the registration process, the user can pick " I am a customer" and " I am a seller". How can we get rid of " I am a customer" option? I only want sellers to sign up. I don not want the choice of customer sign up. Thanks! Suja
February 21, 2015 at 10:14 pm 37305
Nayem Nayem

Hello DM,

Please open Dokan plugin folder/includes/templage-tags.php and find those line-

<label class="radio">
            <input type="radio" name="role" value="customer"<?php checked( $role, 'customer' ); ?>>
            <?php _e( 'I am a customer', 'dokan' ); ?>
</label>

You have to comment out those line. Please check and let me know.

Thank you 🙂

February 27, 2015 at 6:56 am 37771
DM DM

Hey!

I commented out the code. It works to an extent. The user still must pick the “I am seller option”. Once the ” I am seller” is picked the other fields drop down. How can we make the fields not drop down? I want all of the seller fields to show up during registration.

Thanks!

February 28, 2015 at 11:15 am 37826
Nayem Nayem

Hello Dm,

Please paste those code in your child theme function.php. Hope it will solve your problem.

remove_action('register_form','dokan_seller_reg_form_fields');

function seller_reg_form_fields(){

    $role = isset( $_POST['role'] ) ? $_POST['role'] : 'seller';
    $role_style = ( $role == 'customer' ) ? ' style="display:none"' : '';
?>
    <div class="show_if_seller"<?php echo $role_style; ?>>

        <div class="split-row form-row-wide">
            <p class="form-row form-group">
                <label for="first-name"><?php _e( 'First Name', 'dokan' ); ?> <span class="required">*</span></label>
                <input type="text" class="input-text form-control" name="fname" id="first-name" value="<?php if ( ! empty( $_POST['fname'] ) ) echo esc_attr($_POST['fname']); ?>" required="required" />
            </p>

            <p class="form-row form-group">
                <label for="last-name"><?php _e( 'Last Name', 'dokan' ); ?> <span class="required">*</span></label>
                <input type="text" class="input-text form-control" name="lname" id="last-name" value="<?php if ( ! empty( $_POST['lname'] ) ) echo esc_attr($_POST['lname']); ?>" required="required" />
            </p>
        </div>

        <p class="form-row form-group form-row-wide">
            <label for="company-name"><?php _e( 'Shop Name', 'dokan' ); ?> <span class="required">*</span></label>
            <input type="text" class="input-text form-control" name="shopname" id="company-name" value="<?php if ( ! empty( $_POST['shopname'] ) ) echo esc_attr($_POST['shopname']); ?>" required="required" />
        </p>

        <p class="form-row form-group form-row-wide">
            <label for="seller-url" class="pull-left"><?php _e( 'Shop URL', 'dokan' ); ?> <span class="required">*</span></label>
            <strong id="url-alart-mgs" class="pull-right"></strong>
            <input type="text" class="input-text form-control" name="shopurl" id="seller-url" value="<?php if ( ! empty( $_POST['shopurl'] ) ) echo esc_attr($_POST['shopurl']); ?>" required="required" />
            <small><?php echo home_url(); ?>/store/<strong id="url-alart"></strong></small>
        </p>

        <p class="form-row form-group form-row-wide">
            <label for="seller-address"><?php _e( 'Address', 'dokan' ); ?><span class="required">*</span></label>
            <textarea type="text" id="seller-address" name="address" class="form-control input" required="required"><?php if ( ! empty( $_POST['address'] ) ) echo esc_textarea($_POST['address']); ?></textarea>
        </p>

        <p class="form-row form-group form-row-wide">
            <label for="shop-phone"><?php _e( 'Phone', 'dokan' ); ?><span class="required">*</span></label>
            <input type="text" class="input-text form-control" name="phone" id="shop-phone" value="<?php if ( ! empty( $_POST['phone'] ) ) echo esc_attr($_POST['phone']); ?>" required="required" />
        </p>

        <?php  do_action( 'dokan_seller_registration_field_after' ); ?>

    </div>
    <div class="dokan-new-field-wrap" style="display: none;">
        <?php do_action( 'dokn_aditional_relation_filed' ); ?>
    </div>

    <p class="form-row form-group user-role">

        <label class="radio">
            <input type="radio" name="role" value="seller"<?php checked( $role, 'seller' ); ?>>
            <?php _e( 'I am a seller', 'dokan' ); ?>
        </label>
        <?php do_action( 'dokan_registration_form_role', $role ); ?>
    </p>

<?php

} 
add_action('register_form','seller_reg_form_fields');
?>
Viewing 3 Posts - 1 through 3 (of 3 total)