Jetpack CRM Customer role question
-
Testing an external woocommerce site and a woocommerce site with the CRM installed in it.
The external site upon syncing gives the synced users the Jetpack CRM Customer role.
Tge site with woo and crm installed in the same site does not assign crm users to the Jetpack CRM Customer role.
Both crm installations have the exact same settings and plugins and are syncing the exact same data … except one is external and the other syncs locally.
Any ideas?
-
In?WooCommerce Sync, all contacts imported will be added with the default status of
Lead
unless you’ve changed that setting.You can define each WooCommerce order status to map to a specific contact status. This is useful to track contacts through your funnel or to see whether there is a bottleneck at a particular status (e.g. processing).
These settings can be found in Jetpack CRM Settings > WooSync:
Once you’ve set these up, new contacts will be created with a status based on the new mapping configuration.
If you have already imported contacts with the incorrect status,
you can restart the sync from the WooCommerce Sync hub. This will not duplicate existing orders but it will update your customers to have the correct status relevant to their order.
Hope this helps!
Best,
AlbaUmmm … I don’t think you’re addressing the same issue I’m pointing out.
On the external sync scenario:
The users brought into site #1 (the CRM) from site #2 (the online store) upon syncing does correctly assign the synced users the “Jetpack CRM Customer” role.
On the scenario where the CRM and Woo are both installed on the same website:
Users already present on the woocommerce installation with purchases made in woocommerce … upon the sync by JetPack CRM … the users are not assigned the “Jetpack CRM Customer” role.
In fact from JetPack CRM’s own documentation is written, “Jetpack CRM Customer – this role is not normally manually assigned. The system assigns this role to CRM Contacts so that they can access the Client Portal.”
source: https://kb.jetpackcrm.com/knowledge-base/setting-up-your-team/
Besides, I never mentioned “Lead”. The CRM is giving the Lead designation correctly.
I’ve even tried this: https://kb.jetpackcrm.com/knowledge-base/rebuild-jetpack-crm-role-permissions/
to try to correct the problem … no dice.
Not even sure at this point what the words “user” and “role” mean to the CRM. All I know is that the docs say it’s supposed to assign synced users the “Jetpack CRM Customer” role … and it’s NOT on the scenario where tge CRM and the Woocommerce are on the sane site. The external site scenario DOES in fact work correctly!
Does that clear things up?
- This reply was modified 1 year, 9 months ago by Scott.
Any idea?
Hi there, @midipedalboards,
We have extensively tested this, and it looks like you stumbled upon a bug!
We have reported it to our developers, who are going to address this as soon as possible. We’re still investigating, as replicating it is not an easy bug. If we find a workaround to avoid this, we’ll let you know ??
- This reply was modified 1 year, 9 months ago by Stef (a11n).
I’m actually going to try to temporarily work around it by using a WordPress user role editor later today. Hopefully that will work out for the time being.
It seems to me by simply adding the additional role “Jetpack CRM Customer” to the Woo imported users should work. Hopefully it’s that easy. I guess I’ll find out later this afternoon. ??
Hi @midipedalboards ,
Well, curious to hear what happens. ??
Two thoughts:
Although User Role Editor is popular, there can be issues with it making it impossible to restore default role permissions once they’ve been changed. Caveat lector!
It seems to me by simply adding the additional role “Jetpack CRM Customer” to the Woo imported users should work.
It will work if the Jetpack CRM Customer role is listed first, but not second. That’s a bug I recently reported.
Basically, CRM allows you to assign an extra role in
admin.php?page=zerobscrm-plugin-settings&tab=clients
If you do that, however, two things occur:
1 – the extra role is assigned as primary in WP -> Users, with the pre-existing role delegated to secondary. (I made up these ‘primary and secondary’ terms because I didn’t know how else to distinguish them. Primary == the one that appears first.)
In this example, the ‘Second Role’ user was originally just a Jetpack CRM Customer. After adding the additional role, their roles appeared this way:
Screenshot Link: https://cloudup.com/c9liO26DJD1
2 – that user then loses access to the Client Portal.
3 – I didn’t test this with User Role Editor, but presumably what’s happening is that CRM is only seeing the first role.
So – make sure Jetpack CRM Customer comes first. ??
Best,
Cena
I’ll report back what I find.
Hey @midipedalboards,
That’s great – let us know what you find out, and thanks again for troubleshooting this with us.
Speak soon!
Here’s what I’ve come up with as a work around. And it appears to have no downside (yeah I know … but I’ll go out on the limb). ??
Woocommerce and JetPack CRM are installed on the same website installation.
Important Settings for the CRM:
- CRM Settings > Client Portal > Generate WordPress users for new contacts is checked
- CRM Settings > Client Portal > Assign extra role when generating users is set to the default: NONE
- Make sure your mail sending method is setup and working.
- Make sure the very first default mail template is Active to send password instructions. (However, the default WordPress account creation email works too)
Important WordPress Setting:
- Settings > General > New User Default Role set to JetPack CRM Customer
- Save the changes
Done!
Method of testing:
- Created a test product with a price of $0.00 on a live setup (not the test mode woocommerce setting) because the zero price is below the threshold Woocommerce payments will actually run through the credit card payment system but still allow Woocommerce itself to process the “purchase” as a real transaction except no fees to you. It’s just a free product.
- I have Woocommerce settings to allow automatic account creation when someone purchases a product (so no preexisting account involved in this scenario)
- Went to website purchased the zero cost product
- Filled out the checkout form and the purchase was successful
- Was able to visit the Woocommerce My Account page successfully
- Was able to visit the Client Portal successfully
- Email via JetPack CRM was received with instructions on how to reset the password
East peasy. But what happens if you manually add a contact through the CRM?
It’s very anti-climatic, it just works! The manually added contact gets the same email, sets/resets the password and can login to WordPress and the Client Portal. The only difference is by purchasing through Woocommerce one is automattically (see what I did there ??) logged in after the purchase while the manually added contact has to set/reset the password first in order to login through either the My Account Page or the Client Portal.
But what if I want my WordPress New User Default Role to be “Customer”? (this is tricky to explain so I hope I remember this correctly …). But here’s the thing. The Woocommerce added role of “Customer” has less role permissions than the default WordPress “Subscriber” role. Basically the ‘Customer” role has no access to the back end “admin area” where a “Subscriber” role could go to manage their profile and possibly post a blog post or something. The best thing about the Woocommerce “Customer’ role is all profile management is done on the front end in the My Account page … not in the back end … AND doesn’t have to see that redneck “Howdy” greeting ??.
So basically the “Customer” role is unnecessary if one uses the “JetPack CRM Customer” role. No need to worry about which role comes first.
Existing WordPress and Woocommerce users can be added to the CRM manually through the CRM Customer settings as normal. Or, as a bonus, you could leave them “as is” until an additional purchase through Woocommerce was made by adding a small code snippet in the Code Snippets plugin (or one similar to that plugin) or by inserting the snippet in your child theme’s function.php file.
The snippet is:
add_action( 'woocommerce_order_status_processing', 'change_role_on_purchase', 10, 2 ); add_action( 'woocommerce_order_status_completed', 'change_role_on_purchase', 10, 2 ); function change_role_on_purchase( $order_id, $order ) { $user = $order->get_user(); ? if( is_a( $user, 'WP_User' ) && in_array( 'customer', (array) $user->roles ) ) { $user->remove_role( 'customer' ); $user->add_role( 'zerobs_customer' ); } }
This will change the user role in WordPress from “Customer” to the JetPack CRM user role “JetPack CRM Customer” role with no changes required to passwords AFTER an additional Woocommerce purchase is made.
Contacts that pay invoices through the CRM will still be subject to how the CRM adds people to WordPress … so this may be where adding the additional user role of “Customer” would come into play. But I didn’t test that as that would require commercial add ons to JetPack CRM and I’m not currently using any of those.
Anyway … I don’t see why JetPack CRM doesn’t ditch their standard “JetPack CRM Customer” role and just use what’s already built into WordPress or Woocommerce. Maybe keep the other CRM specific user roles for other circumstances … but really this doesn’t have to be complicated.
I hope this rambling was too boring. And as I write this it’s 3:10am MT and I’ve been up all day so if it’s incoherent … well … it didn’t cost ya anything.
Hope this helps somebody.
Be Well!
- This reply was modified 1 year, 9 months ago by Scott. Reason: forgot a detail
Hi @midipedalboards ,
Thanks for this, this is awesome. I tested your snippet and it works! I also tested with Invoicing Pro and Paypal Connect, and all is working there too. So great job! ??
I don’t see why JetPack CRM doesn’t ditch their standard “JetPack CRM Customer” role and just use what’s already built into WordPress or Woocommerce. Maybe keep the other CRM specific user roles for other circumstances … but really this doesn’t have to be complicated.
The developers would likely agree with you – they’re currently in the process of re-evaluating what the user roles should be, their capabilities, and how to add value/robustness to them. That’s a big project, so not likely to change soon. Personally I agree about the Customer vs CRM Customer, but I suppose theoretically there are users who may have Customers who are not also CRM Contacts and would like them to stay that way.
Thanks again for testing and the snippet, Scott. That’s going in my back pocket. ??
Best,
Cena
Personally I agree about the Customer vs CRM Customer, but I suppose theoretically there are users who may have Customers who are not also CRM Contacts and would like them to stay that way.?
And I think the default “Subscriber” would be perfect for that! Cheers
Hi @midipedalboards–
Thank you for your feedback. I have forwarded your finding and feedback to our developers for further consideration and investigation. We’ll let you know when we have updates.
In the meantime, I’m glad you have created a working snippet and made it work–thank you for sharing it with us! ??
@bluejay77 my pleasure.
Hi @midipedalboards,
Our developers have reviewed your feedback, and they’ll consider it for future role management enhancement project.
At the moment, we don’t have an ETA when it’ll be addressed, I’m afraid. Thank you again for sharing your feedback and snippet! We really appreciate it.
- The topic ‘Jetpack CRM Customer role question’ is closed to new replies.