wordpress - Get customers name in Woocommerce -


i working woocommerce , make order confirmation email.

it want mail say:

"hi [customers name]"

how woocommerce print customers name?

thanks in advance!

you need order object, depending on hook using should there. try this:

add_action('woocommerce_order_status_completed','my_woo_email'); function my_woo_email($order_id){             $order = new wc_order( $order_id );            $to = $order->billing_email;            $subject = 'this subject';            $message = 'hi '.$order->billing_first_name.' '.$order->billing_email;$order->billing_last_name.', order!';                  woocommerce_mail( $to, $subject, $message, $headers = "content-type: text/htmlrn", $attachments = "" )  } 

this untested should started


Comments

Popular posts from this blog

javascript - DIV "hiding" when changing dropdown value -

Does Firefox offer AppleScript support to get URL of windows? -

android - How to install packaged app on Firefox for mobile? -