Closed pixel-paul closed 1 year ago
@pixel-paul Thanks for the report. I'll post a fix shortly.
Thanks @christianwach. A similar error is also generated in the WPCV_Woo_Civi_Contact_Phone
class for sync_wp_user_woocommerce_phone
@pixel-paul I can fix the acton callbacks very easily, however this is code that was largely inherited from the previous plugin... and so when I do fix the callbacks on my dev sites I find a whole heap of problems with the sync processes.
Would you or your client be prepared to (or able to) sponsor the code fixes and testing? My email's on my profile if you want to get in touch that way.
Yes, it looks like the sync_wp_user_woocommerce_email
(for example) should be sync_woo_to_civicrm
I would be very doubtful that they would be able to contribute to this, however I would be able to help.
When I corrected the issue, the sync appeared (at least without too much digging) to work....
Yes, it looks like the
sync_wp_user_woocommerce_email
(for example) should besync_woo_to_civicrm
Yep, that gets the code running again. It's just it doesn't work as expected.
This is compounded by WooCommerce Contacts created via the "My Account" screen not receiving the proper Sub-type.
There could be further CiviCRM-to-Woo oddities but that's as far as I got.
OK, so quite significant issues.
Has this happened because of any recent changes? It has been some time since I have looked into the profile syncing and I have just started testing this part of our installation and noticed these issues.
Has this happened because of any recent changes?
@pixel-paul Having had a dig around, I'm not convinced this code ever worked as expected (though yes the mis-named callback issue is my mistake). I was sponsored to rebuild the previous plugin to the extent that I was able to within the budget, and Contact/Customer syncing just didn't make the cut.
Ok, I'm going to start debugging this further and see what I can figure out. By the looks of things, names sync ok....
No need @pixel-paul I have a branch that's mostly there... will push tomorrow for you to test.
Hi @christianwach, that sounds great, thank you. I'll be able to test as soon as you need.
Thanks again!
@pixel-paul Feedback on https://github.com/christianwach/wpcv-woo-civi-integration/tree/profile appreciated.
Hi @christianwach - where would you like me to leave feedback / bugs?
@pixel-paul Let's keep the discussion in one place - so here is probably best.
Hi @christianwach, ok no problem.
I've tested with the profile branch of your fork and I can confirm that the addresses and email are syncing correctly now.
I have found a few bugs:
When saving a record in CiviCRM, an error is generated (this doesn't always happen and appears to only happen if there is no website entered):
Could not delete Website id 50
Changing Nickname in CiviCRM does not save
Adding a website does not save
These are my WPCV settings:
Many thanks,
Paul
Could not delete Website id 50
@pixel-paul I'll need a backtrace to assess if this is a problem with this plugin or your install.
Display Name <—> Nickname sync does not work (I am assuming that this is meant to happen?)
@pixel-paul This has not been a feature of this plugin to date - you'd need to commission additional functionality.
Adding a website does not save
@pixel-paul There's no website as part of the Woo Customer Profile, so this is outside the scope of this plugin.
@pixel-paul I'll need a backtrace to assess if this is a problem with this plugin or your install.
OK, I think you are correct in that the changes you have made are working correctly. The issue I think we are now looking at must be related to one of the other sync plugins. I'm running a clean WP 6.2.2 and these plugins:
When I register an account in Woocommerce, it is synced through to Civi. I can then add a billing address and a shipping address - both sync with Civi (and vice versa). I then add (for example) a website address in CiviCRM, which updates (although takes a very long time), and then when I try and update (for example), 'Last Name', it does not save (with no clear errors generated). I'll need more time to debug this as it is relatively sporadic.
Thanks for the hard work to connect up the WooCommerce addresses!
Paul
@pixel-paul I've merged my fixes into the main repo. If you get to the source of the issues you've been having, let me know and we can look at resolving them.
Thanks @christianwach - I've been caught up in another project, but will get back to you hopefully very soon!
I've tested this further and it is working as it should.
Many thanks for the fixes and time spent @christianwach.
An error is thrown when saving an address in WooCommerce (
/my-account/edit-address/billing/
):Uncaught TypeError: call_user_func_array(): Argument #1 ($callback) must be a valid callback, class WPCV_Woo_Civi_Contact_Email does not have a method "sync_wp_user_woocommerce_email"
Linked to a missing method,
sync_wp_user_woocommerce_email
in/wpcv-woo-civi-integration-main/includes/classes/class-woo-civi-contact-email.php
: