22
33namespace BitCode \FI \Triggers \WC ;
44
5+ use BitCode \FI \Core \Util \Helper ;
6+ use BitCode \FI \Flow \Flow ;
57use WC_Booking ;
68use WC_Checkout ;
79use WC_Product_Simple ;
8- use BitCode \FI \Flow \Flow ;
910use WC_Subscriptions_Product ;
10- use BitCode \FI \Core \Util \Helper ;
1111
1212final class WCController
1313{
@@ -600,7 +600,7 @@ public static function handle_customer_update($customer_id, $oldData, $newData)
600600 return false ;
601601 }
602602
603- if (isset ($ importType ['role ' ]) && $ newData ['role ' ] !== 'customer ' ) {
603+ if (isset ($ newData ['role ' ]) && $ newData ['role ' ] !== 'customer ' ) {
604604 return false ;
605605 }
606606 $ customer_data = (array ) $ newData ;
@@ -626,9 +626,11 @@ public static function handle_customer_delete($customer_id)
626626
627627 $ user_meta = get_userdata ($ customer_id );
628628 $ user_roles = $ user_meta ->roles ;
629- if (isset ($ importType ['role ' ]) && \in_array ('customer ' , $ user_roles )) {
629+
630+ if (!\in_array ('customer ' , $ user_roles )) {
630631 return false ;
631632 }
633+
632634 $ customer_data = ['customer_id ' => $ customer_id ];
633635 if (!empty ($ customer_id ) && $ flows = Flow::exists ('WC ' , 3 )) {
634636 Flow::execute ('WC ' , 3 , $ customer_data , $ flows );
@@ -885,7 +887,7 @@ public static function accessOrderData($order)
885887 $ data ['line_items ' ][] = (object ) $ itemData ;
886888 }
887889 $ data ['product_names ' ] = implode (', ' , array_column ($ data ['line_items ' ], 'product_name ' ));
888- $ data ['line_items_quantity ' ] = count ($ data ['line_items ' ]);
890+ $ data ['line_items_quantity ' ] = \ count ($ data ['line_items ' ]);
889891
890892 return $ data ;
891893 }
0 commit comments