Customizing WooCommerce Order Emails

Conditional Customization with Actions/Filters 


add_action( 'woocommerce_email_before_order_table', 'add_order_email_instructions', 10, 2 );
 
function add_order_email_instructions( $order, $sent_to_admin ) {
  
  if ( ! $sent_to_admin ) {
 
    if ( 'cod' == $order->payment_method ) {
      // cash on delivery method
      echo 'Instructions: Full payment is due immediately upon delivery: cash only, no exceptions.
'
;
    } else {
      // other methods (ie credit card)
      echo 'Instructions: Please look for "Madrigal Electromotive GmbH" on your next credit card statement.
'
;
    }
  }
}

Link
http://www.remicorson.com/woocommerce-display-coupons-used-in-an-order-in-the-confirmation-email/
https://www.sellwithwp.com/customizing-woocommerce-order-emails/

No comments:

Post a Comment