Added PR feedback.

This commit is contained in:
Julià Mestieri 2020-08-26 16:12:06 +02:00
parent b2c35a5ded
commit 83434deb42
3 changed files with 3 additions and 1 deletions

View File

@ -64,6 +64,7 @@ class WC_Customer_Data_Store extends WC_Data_Store_WP implements WC_Customer_Dat
'syntax_highlighting',
'_order_count',
'_money_spent',
'_last_order',
'_woocommerce_tracks_anon_id',
);

View File

@ -456,7 +456,7 @@ function wc_delete_shop_order_transients( $order = 0 ) {
delete_transient( $transient );
}
// Clear money spent for user associated with order.
// Clear customer's order related caches.
if ( is_a( $order, 'WC_Order' ) ) {
$order_id = $order->get_id();
delete_user_meta( $order->get_customer_id(), '_money_spent' );

View File

@ -272,6 +272,7 @@ function wc_update_new_customer_past_orders( $customer_id ) {
update_user_meta( $customer_id, 'paying_customer', 1 );
update_user_meta( $customer_id, '_order_count', '' );
update_user_meta( $customer_id, '_money_spent', '' );
delete_user_meta( $customer_id, '_last_order' );
}
return $linked;