WC_Customer_Download_Data_Store::update_user_by_order_id()
Update user prop for downloads based on order id.
Method of the class: WC_Customer_Download_Data_Store{}
No Hooks.
Return
null
. Nothing (null).
Usage
$WC_Customer_Download_Data_Store = new WC_Customer_Download_Data_Store(); $WC_Customer_Download_Data_Store->update_user_by_order_id( $order_id, $customer_id, $email );
- $order_id(int) (required)
- Order ID.
- $customer_id(int) (required)
- Customer ID.
- $email(string) (required)
- Customer email address.
WC_Customer_Download_Data_Store::update_user_by_order_id() WC Customer Download Data Store::update user by order id code WC 9.4.2
public function update_user_by_order_id( $order_id, $customer_id, $email ) { global $wpdb; $wpdb->update( $wpdb->prefix . 'woocommerce_downloadable_product_permissions', array( 'user_id' => $customer_id, 'user_email' => $email, ), array( 'order_id' => $order_id, ), array( '%d', '%s', ), array( '%d', ) ); }