You are viewing an old revision of this post, from April 10, 2018 @ 02:17:48. See below for differences between this version and the current revision.

Update User Meta After a Successful Order in WooCommerce

As seen on Rodolfo's Business Bloomer website. [php]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'); } }[/php]

Revisions

  • April 10, 2018 @ 02:17:48 [Current Revision] by PeterLugg
  • April 10, 2018 @ 02:17:48 by PeterLugg

Revision Differences

There are no differences between the April 10, 2018 @ 02:17:48 revision and the current revision. (Maybe only post meta information was changed.)

Tags:

No comments yet.

Leave a Reply