Categories

Tuesday, June 25, 2024
#919814419350 therichposts@gmail.com
DokanmultivendorWoocommerceWordpress

Dokan Multi Vendor select Register as Vendor by default

Dokan Multi Vendor select Register as Vendor by default

Hello guys, how are you? Welcome back to my blog. Guys Today in this blog post we will do Dokan Multi Vendor select Register as Vendor by default (a popular multi-vendor marketplace plugin for WordPress) can be done through various methods. Here is a step-by-step guide to achieve this:

  1. WooCommerce Hooks
  2. WordPress Tricks
  3. WordPress Hooks
  4. Dokan
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
    ) );
}

Second way via using jquery:

//Using jquery
function add_custom_script_to_footer() {
    ?>
    <script type="text/javascript">
        // Your custom JavaScript code here
       
        jQuery(document).ready(function($){
             $(".vendor-customer-registration input:radio[name=role][value=customer]").prop('checked', false);
             $(".vendor-customer-registration input:radio[name=role][value=seller]").prop('checked', true);

        });
    </script>
    <?php
}

CONCLUSION

By following these steps, you can streamline the process and ensure your product data is accurate and complete. If you encounter any issues, refer to the Dokan documentation or seek support then please comment below or contact me.

Jassa

Thanks

therichpost
the authortherichpost
Hello to all. Welcome to therichpost.com. Myself Ajay Malhotra and I am freelance full stack developer. I love coding. I know WordPress, Core php, Angularjs, Angular 14, Angular 15, Angular 16, Angular 17, Bootstrap 5, Nodejs, Laravel, Codeigniter, Shopify, Squarespace, jQuery, Google Map Api, Vuejs, Reactjs, Big commerce etc.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.