-1

I want to know how to call out a extra email filed in woocommerce checkout page. By default there is a email filed for customers to fill in, once he/she checkout they will receive the order copy. I just want to call out another email filed eg Email 2 then that email also should receive the copy. Already tried finding for plugins but didn't work. Any idea to execute..! Thank You

0

This solution seems to be very close to what you need. But can't say duplicated as you will need to do some coding to get 2nd email address. Check out.

Adding a second email address to a completed order in WooCommerce

To get email field from checkout try

get_post_meta( $order_id, '_custom_field', true );

now you might want to get $order_id

add_action ('woocommerce_thankyou', 'myfunction');
function myfunction($order_id) {
  $order = new WC_Order($order_id);
  print $order_id.', '.$order->get_total();
}

Hopefully this will take you in right direction.

  • Thanks gangesh for the help. Btw i checked that thread before posting here – NaFi Jul 2 '16 at 21:24
  • @MohammedNaflan and? What problem you are facing implementing it? – Gangesh Jul 2 '16 at 21:25
  • 'add_filter( 'woocommerce_email_recipient_customer_completed_order', 'your_email_recipient_filter_function', 10, 2); function your_email_recipient_filter_function($recipient, $object) { $recipient = $recipient . ', me@myemail.com'; return $recipient; }' Cant we call User Email instead of mentioning a email (me@myemail.com). What i mean is the site is a franchise concept, where we allow users to signup as a franchise and allow to purchase goods directly from us. so here order details will be mailed to admin as well as the customer he orders but he don't get it. – NaFi Jul 2 '16 at 21:31
  • you said admin and customer. you didn't mention anything about 2nd email in checkout form. Admin and customer always get emails. – Gangesh Jul 2 '16 at 21:40
  • franchise user role is our 2 email , of-course admin will get but if I assign someone as franchise they dont get a order copy. we dont allow franchise to access to backend wordpress – NaFi Jul 2 '16 at 21:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.