Home Forums Theme Support Dokan Auto-activate Sellers

This topic is: resolved

Tagged: ,

This topic contains 9 replies, has 4 voices, and was last updated by  Gabriel 4 years, 7 months ago.

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #25351

    pixeledmedia
    Participant
    Post count: 18

    Hi,

    I use Gravity Forms (with the User Registration addon) to register new sellers to the website instead of Woocommerce.

    So when I select the “Make selling status enable for new registred seller” checkbox in the Dokan Settings, it does not automatically enable the seller status for every user.

    Is there another way to auto-activate selling capabilities for all users with the ‘Seller' role?

    I really need this.

    Thanks again,
    Lewis

    #25537

    Sekander Badsha
    Member
    Post count: 2067

    Hello Lewis,
    I don't have any idea about the Gravity form. Is there a setting while registering the users to set their role? If yes, then you should be able to do it by setting the default user role to “Seller”.

    #25539

    pixeledmedia
    Participant
    Post count: 18

    Thanks for the reply,

    Yep Gravity Forms has the option to select a user's role, but after looking through the Dokan code, I have a question;

    Is the option “Make selling status enable for new registered seller” a WordPress capability or is it user_meta?

    #25662

    Sekander Badsha
    Member
    Post count: 2067

    “Make selling status enable for new registered seller” is a user_meta

    #26034

    Simon
    Member
    Post count: 58

    Hey Pixeledmedia,

    I'm trying to setup a custom seller registration form using Gravity Form's User Registration also. Did you manage to get it to work?

    #26048

    Simon
    Member
    Post count: 58

    In addition to getting the form to automatically active the seller, I've run into an issue with trying to set the user_nicename for the store url. user_nicename isn't stored in user_meta, but in wp_user.

    #26054

    pixeledmedia
    Participant
    Post count: 18

    Hey Simon,

    I have actually unfortunately managed to find a solution for this yet. If the seller permissions were actually WordPress capabilities instead of user_meta/wp_user then I could use the User Role Editor plugin to auto-assign capabilities for new sellers registered to my website without using the Woocommerce form that Dokan uses.

    #26570

    Simon
    Member
    Post count: 58

    Hey Lewis,

    Put the following in your functions.php file. Make sure to change the 1 in “gform_post_submission_1” to the ID of the gravity form you are using for user registration.

     add_action('gform_post_submission_1', 'marvel_update_dokan_enable_selling', 10, 2);
     function marvel_update_dokan_enable_selling() {
         $current_user = wp_get_current_user();
         $current_user_id = $current_user->ID;
         
         update_user_meta( $current_user_id, 'dokan_enable_selling', 'yes' );
         
     }
    #26614

    pixeledmedia
    Participant
    Post count: 18

    Thanks for that Simon,

    It works perfectly, really appreciate it!

    #30663

    Gabriel
    Member
    Post count: 15

    Hi guys,

    Can you tell me which Gravity Forms plugin you are using? In the WP plugin directory there seem to be a lot from different companies.

    I'm having the same problem: trying to make it so all my users can sell.

    Thanks!

    -Gabe

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

The topic ‘Auto-activate Sellers’ is closed to new replies.