Viewing 1 replies (of 1 total)
  • Hello @mainadministrator,

    To select “I am a vendor” by default kindly use the below code on your child-theme functions.php file –

    
    /*
    @ Change my account page registration radio button to Become a Vendor active by default.
    */
     
    remove_action( 'woocommerce_register_form', 'dokan_seller_reg_form_fields' );
     
    add_action( 'woocommerce_register_form', 'dokan_custom_reg_vendor_selected', 12 );
     
    function dokan_custom_reg_vendor_selected() {
        $postdata = wc_clean( $_POST ); // WPCS: CSRF ok, input var ok.
        $role = isset( $postdata['role'] ) ? $postdata['role'] : 'seller';
        $role_style = ( $role == 'customer' ) ? 'display:none' : '';
     
        dokan_get_template_part( 'global/seller-registration-form', '', array(
            'postdata' => $postdata,
            'role' => $role,
            'role_style' => $role_style
        ) );
    }

    To hide “I am a customer”:

    You can hide the vendor registration form template file.

    /wp-content/plugins/dokan-lite/templates/global/seller-registration-form.php
    Comment out line no: 68-71

    <label class=”radio”>

    <input type=”radio” name=”role” value=”seller”<?php checked( $role, ‘seller’ ); ?>> <?php esc_html_e( ‘I am a vendor’, ‘dokan-lite’ ); ?>

    </label>

    Use // to comment out. Make the changes using a child theme so that you do not lose the changes during an update. To know how you can override a template check this process.

    Cheers!

Viewing 1 replies (of 1 total)
  • The topic ‘Check this “I am a vendor” checkbox by Default’ is closed to new replies.