• Resolved fchantal11

    (@fchantal11)


    The plugin only takes the default user roles customer and subscriber, but we have created a custom role name. Is there a way to make the plugin for with this custom role rather than it only taking the native Woo roles?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author mediaticus

    (@mediaticus)

    Hi @fchantal11,

    Thank you for reching out!

    Could you please try to:

    • Add the following line of code to your site’s wp-config.php file: define( 'SFWC_VALID_ROLE_LOOSE_MODE', true );
    • Go to: Dashboard → WooCommerce → Subaccounts → Options tab → Select the buyer role(s) to enable the subaccount system for
    • Check if the role you would like to enable is now available for selection (if it’s available, select it and click “Save changes”)
    • If the role is still not showing, you should add the following snippet of code to your child theme’s functions.php file (remember to replace additional_role with the actual role name)

    // Enable additional roles for Subaccounts for WooCommerce plugin.
    function m3di4ticus_sfwc_enable_additional_roles( $current_user_roles ) {

    // Replace additional_role with the actual name of the role that should be enabled.
    array_push( $current_user_roles, 'additional_role' );

    // If you need to enable more than one role.
    // array_push( $current_user_roles, 'additional_role_1', 'additional_role_2', 'additional_role_3' );

    return $current_user_roles;
    }
    add_filter( 'sfwc_add_valid_roles', 'm3di4ticus_sfwc_enable_additional_roles', 10, 1 );

    The role(s) should now be available for selection, always in: Dashboard → WooCommerce → Subaccounts → Options → Select the buyer role(s) to enable the subaccount system for.

    Please let us know if the above procedure fixes your issue. If anything is unclear or you encounter any issues please let us know.

    Plugin Author mediaticus

    (@mediaticus)

    We haven’t heard from you in a while so I’m going to go ahead and mark this thread as resolved.

    If you have any other questions about the plugin, please start a new thread.

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.