Advertisement
Guest User

PHP Code for Woocommerce Emails

a guest
Jul 3rd, 2016
8,311
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.38 KB | None | 0 0
  1. //Code For Order ID
  2. <?php echo $order->id; ?>
  3.  
  4. //Code For Order Date
  5. <?php echo $order->order_date; ?>
  6.  
  7. //Code For Shipping First and Last Name
  8. <?php echo $order->shipping_first_name . " " . $order->shipping_last_name; ?>
  9.  
  10. //Code For Shipping address
  11. <?php echo $order->shipping_address_1; ?>
  12.  
  13. //Code For Shipping Apartment Number
  14. <?php if($order->shipping_address_2 != ""){ echo '<br>' . $order->shipping_address_2;}?>
  15.  
  16. //Code For Shipping Country
  17. <?php $countries = new WC_Countries; $shipping_country = $order->shipping_country; echo ( $shipping_country && isset( $countries->countries[ $shipping_country ] ) ) ? $countries->countries[ $shipping_country ] : $shipping_country; ?>
  18.  
  19. //Code For Billing First and Last Name
  20. <?php echo $order->billing_first_name . " " . $order->billing_last_name; ?>
  21.  
  22. //Code For Billing address
  23. <?php echo $order->billing_address_1; ?>
  24.  
  25. //Code For Billing Apartment Number
  26. <?php if($order->billing_address_2 != ""){ echo '<br>' . $order->billing_address_2;}?>
  27.  
  28. //Code For Billing Country
  29. <?php $countries = new WC_Countries; $billing_country = $order->billing_country; echo ( $billing_country && isset( $countries->countries[ $billing_country ] ) ) ? $countries->countries[ $billing_country ] : $billing_country; ?>
  30.  
  31. //Code For Order Items/Products
  32. <?php do_action( 'woocommerce_email_order_details', $order, $sent_to_admin, $plain_text, $email ); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement