Greetings,
Whenever I’m attempting to save new customer information like altering their email addresses or name attached to their account, I receive a crucial error relating to WooCommerce.
I tested this issue on a staging site and discovered that this mistake persists even after disabling all plugins except for WooCommerce. I tested it on different themes (Astra & Divi) and still encountered the same issue.
Please find below an example of the critical error I discovered in my Fatal Error Logs.
2023-05-01T04:38:43+00:00 CRITICAL Uncaught Error: Call to a member function date() on null in /home2/touchofmink/public_html/wp-content/plugins/woocommerce/src/Admin/API/Reports/Customers/DataStore.php:750
Stack trace:
#0 /home2/touchofmink/public_html/wp-includes/class-wp-hook.php(310): Automattic\WooCommerce\Admin\API\Reports\Customers\DataStore::update_registered_customer(268038)
#1 /home2/touchofmink/public_html/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters(NULL, Array)
#2 /home2/touchofmink/public_html/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
#3 /home2/touchofmink/public_html/wp-includes/user.php(2461): do_action('profile_update', 268038, Object(WP_User), Array)
#4 /home2/touchofmink/public_html/wp-includes/user.php(2582): wp_insert_user(Array)
#5 /home2/touchofmink/public_html/wp-content/plugins/woocommerce/includes/data-stores/class-wc-customer-data-store.php(193): wp_update_user(Array)
#6 /home2/touchofmink/public_html/wp-content/plugins/woocommerce/includes/class-wc-data-store.php(196): WC_Customer_Data_Sto in /home2/touchofmink/public_html/wp-content/plugins/woocommerce/src/Admin/API/Reports/Customers/DataStore.php on line 750
To fix the critical error when editing the customer profile in WooCommerce, you can follow these troubleshooting steps:
1. Enable debug mode in WordPress. Go to your wp-config.php file and add the following code to the end of the file:
`define( ‘WP_DEBUG’, true );
define( ‘WP_DEBUG_LOG’, true );
define( ‘WP_DEBUG_DISPLAY’, false );`
2. Try to recreate the error while being logged in as an administrator. This will help you see the error message on the screen.
3. Once you have the error message, search for it on Google. You might find a solution or a similar case with a successful resolution.
4. If the issue is due to a plugin conflict, disable all plugins except for WooCommerce. Then, try to recreate the error. If the error disappears, reactivate the plugins one-by-one until you find the conflict plugin.
5. If the issue persists after disabling conflict plugins, switch the theme to the default Twenty Twenty-One theme, and try again. If this works, your theme might have a conflict, and you should contact the theme developer for support.
6. If none of the above resolves the critical error, reinstall WooCommerce or upgrade to the latest version of WooCommerce.
7. Contact WooCommerce support for help if the above steps don’t solve the issue.
I hope these steps help you in resolving the issue.
I recommend asking at https://wordpress.org/support/plugin/woocommerce/#new-post so the plugin’s developers and support community can help you with this.
fvh7gu