Auto-activate Sellers

This topic contains 9 reply and 4 voices, and was last updated by Gabriel 10 years ago
Viewing 9 Posts - 1 through 9 (of 9 total)
Author Posts
August 17, 2014 at 8:30 am 25351
Gabriel 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
August 19, 2014 at 10:26 pm 25537
Sekander Badsha Sekander Badsha

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”.

August 19, 2014 at 10:36 pm 25539
pixeledmedia pixeledmedia

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?

August 21, 2014 at 9:16 pm 25662
Sekander Badsha Sekander Badsha

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

August 29, 2014 at 8:51 am 26034
Simon Simon

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?

August 29, 2014 at 7:54 pm 26048
Simon Simon

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.

August 29, 2014 at 11:46 pm 26054
pixeledmedia pixeledmedia

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.

September 10, 2014 at 8:44 am 26570
Simon Simon

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' );
     
 }
September 10, 2014 at 10:36 pm 26614
pixeledmedia pixeledmedia

Thanks for that Simon,

It works perfectly, really appreciate it!

November 18, 2014 at 8:32 am 30663
Gabriel Gabriel

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 9 Posts - 1 through 9 (of 9 total)