Update Custom Order Meta After a Successful Order in WooCommerce
Add this code at the bottom of your theme's functions.php /* Add Shop Location Meta after order create*/ add_action( 'woocommerce_thankyou', 'rb_checkout_save_order_meta'); function rb_checkout_save_order_meta( $order_id ) { update_post_meta( $order_id, 'shop_location', 'WW'); }