mediaticus
Forum Replies Created
-
Forum: Plugins
In reply to: [Subaccounts for WooCommerce] Plugin wont take custom roleHi @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.
Forum: Plugins
In reply to: [Subaccounts for WooCommerce] Customize Subaccount Email NotificationsThank you for reaching out and thanks for your suggestion!
I can confirm that we have added your feature request to our roadmap.
Please let us know if you have any other questions or concerns.
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.
Hi @w4yp01nt,
Thank you for reaching out!
Actually that’s a good point. This happens in Multi-User mode when a manager places an order on behalf of a subaccount, is this correct?
We will have to find a good way to handle this. I will leave the status of this thread as “not resolved” for now.
Thanks for reporting this.
Hi @beetr8t,
I’m glad to be of help.
Can I also ask you to confirm, with just a yes, that if John Doe calls in and says “Switch Rebecca and me so she’s the manager and I’m her sub”, I can switch them as he wants (obviously assuming I am on your premium plugin)?
Yes, I can confirm that it is technically possible. It can be done by the administrator from the backend user profile settings page.
If you have any other questions or concerns, don’t hesitate to ask.
Hi @beetr8t,
Thank you for reaching out!
The main difference between Sub-User mode and Multi-User mode can be better explained with the below example.
Given the below account structure:
- Manager: John Doe
- Subaccount: Rebecca Smith
In Sub-User mode orders placed by the subaccount Rebecca Smith are assigned to Rebecca Smith herself. However, if necessary, you (the administrator) can force Rebecca Smith’s billing/shipping addresses to be the same as those of the Manager.
In Multi user mode instead, all orders are always tied to the parent account (Manager). Even orders placed by subaccounts are assigned to the Manager (or to the Supervisor, if the Supervisor Add-On is installed and active).
In my case, I mainly seek to let different individuals perform orders on their company’s aggregate commercial account with us, but with that traceability of who placed each order.
In this case I recommend enabling/using the Multi-User mode.
This because in Multi-User mode a parent account (Manager) is more intended as a Company Account and subaccounts are intended as employees of the company (each subaccount representing a different purchasing department of the company).
For this reason, if Multi-User mode is enabled, all orders (whether placed by the Manager or by subaccounts) are associated to the company (the parent account).
Hope this helps.
Forum: Plugins
In reply to: [Subaccounts for WooCommerce] Nonce could not be verifiedWe 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.
Forum: Plugins
In reply to: [Subaccounts for WooCommerce] Nonce could not be verifiedHi @thuisfeestje,
Thank you for reaching out!
The reported issue has been addressed on version 1.6.2. If you still have any issues, feel free to come back and let us know.
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.
Forum: Plugins
In reply to: [Subaccounts for WooCommerce] Role inheritance?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.
Hi @jared1eob,
We responded to your email on October 23, could you please confirm that you received our email?
Forum: Plugins
In reply to: [Subaccounts for WooCommerce] Role inheritance?Hi @w4yp01nt,
Could you please try the snippet of code below and let us know if it works as expected?
// Make subaccounts created on frontend inherit user roles from the parent account.
add_action( 'sfwc_frontend_after_add_subaccount_validation', 'm3di4ticus_inherit_parent_roles_on_frontend_subaccount_creation', 10, 2);
function m3di4ticus_inherit_parent_roles_on_frontend_subaccount_creation( $parent_user_id, $user_id ) {
if ( is_user_logged_in() ) {
// Get parent account data.
$parent = get_userdata( $parent_user_id );
// Get subaccount data.
$subaccount = get_userdata( $user_id );
// Get parent account role(s).
$parent_roles = sfwc_is_user_role_valid( $parent_user_id );
// Set parent's roles.
if( ! empty( $parent_roles ) ) {
foreach( $parent_roles as $parent_role ) {
$subaccount->add_role( $parent_role );
}
}
}
}Important note: The above functionality will soon be included in the plugin. To avoid any conflicts or race conditions, remember to remove the above code from your functions.php file or from any code snippet plugin (you can take a look at our plugin’s changelog to see if the above functionality is present).
Hope this helps.
Forum: Plugins
In reply to: [Subaccounts for WooCommerce] Role inheritance?Hi @w4yp01nt,
Thank you for reaching out!
I had a look at your code, thanks for contributing to the plugin. Your approach seems good, other users may find it useful as well. ??
We are also planning to add a new option in the backend plugin settings page, which will allow the admin to decide whether subaccounts should inherit the manager (parent account) role when a new subaccount is created on the frontend. This could be useful in your case.
Regarding the possibility to enable additional roles, we will soon allow developers to add additional roles among the enabled ones via
add_filter
.If you have any other questions about the plugin, just let us know.
Hi @jared1eob,
Thank you for reaching out!
We would like to better understand the customizations that need to be made. Could you please send us an email explaining in detail the necessary customizations?
You can contact us via: Dashboard → WooCommerce → Subaccounts → Contact Us.
Forum: Plugins
In reply to: [Subaccounts for WooCommerce] Multisite installations…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.
- Add the following line of code to your site’s wp-config.php file: