As seen on Rodolfo’s Business Bloomer website.
add_action( 'woocommerce_thankyou', 'bbloomer_checkout_save_user_meta'); function bbloomer_checkout_save_user_meta( $order_id ) { $order = new WC_Order( $order_id ); $user_id = $order->get_user_id(); if ( $order->get_total() > 100 ) { // Define your condition here update_user_meta( $user_id, 'custom_checkbox', 'on'); } }
Revisions
- April 10, 2018 @ 02:17:48 [Current Revision] by PeterLugg
- April 10, 2018 @ 02:17:48 by PeterLugg
No comments yet.