SlideShare a Scribd company logo
1 of 4
Download to read offline
How to Get WooCommerce Order Details?
As we know that, WooCommerce is the most popular platform for eCommerce
solutions, and it already has by default templates of each page with the default
template design.
So, sometimes we want to change the design of the template with our custom
template and in that template, we need order details to show as per custom
design.
Let’s get started.
Get WooCommerce Order Details
We have to send in the custom email body content. So there, we have to use the
WC_Order object to get WooCommerce order details.
We can also use the wc_get_orders(), this is function to get the order object and
get the order details on certain parameter.
RECENT POSTS
CATEGORIES
MOST VIEWED POSTS
FOLLOW US
Stay updated via social channels
HOW TO WOOCOMMERCE WORDPRESS
Blog Categories  Tips & Tricks Contact

HOME WOOCOMMERCE HOW TO GET WOOCOMMERCE ORDER DETAILS?
AMAN MEHRA FEBRUARY 27, 2021 LEAVE A COMMENT
Tweet on Twitter Share on Facebook
How to Add WooCommerce Cart
Icon in Menu with Item Count?
How to Secure Password Using
bcrypt in PHP?
How to Make a DataTable in
ReactJS?
How to Inline Style in ReactJS?
How to Install WordPress Theme
(2021 Edition)?
How To
PHP
ReactJS
Tips & Tricks
WooCommerce
WordPress
WooCommerce Remove
Update Cart Button and
Make it Automatically
Update.
October 5, 2020
How to Change Price of
Speci c Product and
Quantity in Cart?
October 14, 2020
How to Redirect to
Checkout After Add to
Cart?
October 16, 2020
How can I Prevent SQL
Injection in PHP?
October 7, 2020
Upload Multiple Featured
Images in a Post OR Page
January 4, 2021
$order_id = 145;
$order = new WC_Order( $order_id );
//$order = wc_get_order( $order_id );
$orderid = $order->get_id(); // Get the order ID
$parent_id = $order->get_parent_id(); // Get the parent
$user_id = $order->get_user_id(); // Get the user ID
$user = $order->get_user(); // Get the WP_User obje
// Get Order Status
$order_status = $order->get_status(); // Get the order
// Get Order Dates
$date_created = $order->get_date_created(); // Get date
$date_modified = $order->get_date_modified(); // Get dat
$date_completed = $order->get_date_completed(); // Get o
$date_paid = $order->get_date_paid(); //Get order paid d
//Get Order Billing Details
$billing_first_name = $order->get_billing_first_name();
$billing_last_name = $order->get_billing_last_name();
$billing_company = $order->get_billing_company();
$billing_address1 = $order->get_billing_address_1();
$billing_address2 = $order->get_billing_address_2();
$billing_city = $order->get_billing_city();
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
So, we see how to get WooCoomerce order details with the help of getter
method. You can check more method here.
If you want to get and access the protected data of the order object then, you
can use the get_data() function.
It is the same as we did above with the instance of the $order object. E.g:
$order->get_data()
It will return the data as an associative array and we can use this array with
key=>pair value.
Let’s see the example.
$billing_state = $order->get_billing_state();
$billing_postcode = $order->get_billing_postcode();
$billing_country = $order->get_billing_country();
$billing_email = $order->get_billing_email();
$billing_phone = $order->get_billing_phone();
$billing_formatted_name = $order->get_formatted_billing_
$billing_formatted_address = $order->get_formatted_billi
//Get Order Shipping Details
$shipping_first_name = $order->get_shipping_first_name(
$shipping_last_name = $order->get_shipping_last_name();
$shipping_company = $order->get_shipping_company();
$shipping_address1 = $order->get_shipping_address_1();
$shipping_address2 = $order->get_shipping_address_2();
$shipping_city = $order->get_shipping_city();
$shipping_state = $order->get_shipping_state();
$shipping_postcode = $order->get_shipping_postcode();
$shipping_country = $order->get_shipping_country();
$shipping_formatted_name = $order->get_formatted_shippin
$shipping_formatted_address = $order->get_formatted_ship
//Get Order Payment Details
$currency = $order->get_currency(); // Get the curr
$payment_title = $order->get_payment_method_title(); //
$payment_method = $order->get_payment_method(); // Get t
$fees = $order->get_fees(); // Get the order fees
$subtotal = $order->get_subtotal(); // Get the order sub
$total_tax = $order->get_total_tax(); // Get the order t
$total = $order->get_total(); // Get the order total
$order_id = 145;
$order = wc_get_order( $order_id );
$order_data = $order->get_data(); // Get the Order data
$orderid = $order_data['id']; // Get the order ID
$parent_id = $order_data['parent_id']; // Get the parent
// Get Order Status
$order_status = $order_data['status']; // Get the order
// Get Order Dates
$date_created = $order_data['date_created']; // Get dat
$date_modified = $order_data['date_modified']; // Get da
$date_completed = $order_data['date_completed']; // Get
$date_paid = $order_data['date_paid']; //Get order paid
//Get Order Billing Details
$billing_first_name = $order_data['billing']['first_name
$billing_last_name = $order_data['billing']['last_name'
$billing_company = $order_data['billing']['company'];
$billing_address1 = $order_data['billing']['address_1']
$billing_address2 = $order_data['billing']['address_2']
$billing_city = $order_data['billing']['city'];
$billing_state = $order_data['billing']['state'];
$billing_postcode = $order_data['billing']['postcode'];
$billing_country = $order_data['billing']['country'];
$billing_email = $order_data['billing']['email'];
$billing_phone = $order_data['billing']['phone'];
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
How to Add WooCommerce Cart Icon
in Menu with Item Count?
How to Secure Password Using
bcrypt in PHP?
With the get_data() function you can use order data as a array properties for get
WooCommerce order details.
You can also loop the order items with get_items() function, if you have
multiple items in one order.
See the simple example to understand this.
Here, we loop the order items and get the value with getter method, as we used
in above.
So in this article we work with:
WC_Order
wc_get_order()
get_data()
get_items()
I hope you understand! how to get WooCommerce order details and use it?
YOU MAY ALSO LIKE
GET ORDER DETAILS
 WOOCOMMERCE ORDER
 WOOCOMMERCE ORDER DETAILS

Tweet on Twitter Share on Facebook
//Get Order Shipping Details
$shipping_first_name = $order_data['shipping']['first_na
$shipping_last_name = $order_data['shipping']['last_name
$shipping_company = $order_data['shipping']['company'];
$shipping_address1 = $order_data['shipping']['address_1
$shipping_address2 = $order_data['shipping']['address_2
$shipping_city = $order_data['shipping']['city'];
$shipping_state = $order_data['shipping']['state'];
$shipping_postcode = $order_data['shipping']['postcode'
$shipping_country = $order_data['shipping']['country'];
//Get Order Payment Details
$subtotal = $order_data['subtotal']; // Get the order su
$total_tax = $order_data['total_tax']; // Get the order
$total = $order_data['total']; // Get the order total
foreach ( $order->get_items() as $item_id => $item ) {
$product = $item->get_product();
$product_id = $item->get_product_id();
$variation_id = $item->get_variation_id();
$name = $item->get_name();
$quantity = $item->get_quantity();
$subtotal = $item->get_subtotal();
$total = $item->get_total();
$tax = $item->get_subtotal_tax();
$all_meta = $item->get_meta_data();
$single_meta = $item->get_meta( '_meta_key', true );
$type = $item->get_type();
//and so on...
}
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
How to Make a DataTable in
ReactJS?
How to Inline Style in ReactJS?
How to Install WordPress Theme
(2021 Edition)?
How to Install WordPress –
Beginners Guide?
Name * Email * Website
ABOUT THE AUTHOR: AMAN MEHRA
Hey! I'm Aman Mehra and I'm a full-stack developer and have 5+
years of experience. I love coding and nd solutions to bugs.
LEAVE A REPLY
Your email address will not be published. Required elds are marked *
Comment
Save my name, email, and website in this browser for the next time I comment.
© 2020 Your Blog Coach Privacy Policy Terms and Conditions Sitemap
POST COMMENT
ABOUT
Your Blog Coach is the best site
for nding the solution to any
issue related to coding and learn
more cool stuff and tricks.
QUICK LINKS
Blog
WordPress
WooCommerce
Contact
RECENT POSTS
How to Add WooCommerce Cart
Icon in Menu with Item Count?
How to Secure Password Using
bcrypt in PHP?
How to Make a DataTable in
ReactJS?
JOIN OUR NEWSLETTER
Name
Email
SUBSCRIBE

More Related Content

Recently uploaded

Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...
FIDO Alliance
 
Breaking Down the Flutterwave Scandal What You Need to Know.pdf
Breaking Down the Flutterwave Scandal What You Need to Know.pdfBreaking Down the Flutterwave Scandal What You Need to Know.pdf
Breaking Down the Flutterwave Scandal What You Need to Know.pdf
UK Journal
 
Structuring Teams and Portfolios for Success
Structuring Teams and Portfolios for SuccessStructuring Teams and Portfolios for Success
Structuring Teams and Portfolios for Success
UXDXConf
 
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptxHarnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
FIDO Alliance
 

Recently uploaded (20)

Google I/O Extended 2024 Warsaw
Google I/O Extended 2024 WarsawGoogle I/O Extended 2024 Warsaw
Google I/O Extended 2024 Warsaw
 
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
 
Intro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераIntro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджера
 
Oauth 2.0 Introduction and Flows with MuleSoft
Oauth 2.0 Introduction and Flows with MuleSoftOauth 2.0 Introduction and Flows with MuleSoft
Oauth 2.0 Introduction and Flows with MuleSoft
 
Event-Driven Architecture Masterclass: Challenges in Stream Processing
Event-Driven Architecture Masterclass: Challenges in Stream ProcessingEvent-Driven Architecture Masterclass: Challenges in Stream Processing
Event-Driven Architecture Masterclass: Challenges in Stream Processing
 
AI mind or machine power point presentation
AI mind or machine power point presentationAI mind or machine power point presentation
AI mind or machine power point presentation
 
2024 May Patch Tuesday
2024 May Patch Tuesday2024 May Patch Tuesday
2024 May Patch Tuesday
 
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
 
The Metaverse: Are We There Yet?
The  Metaverse:    Are   We  There  Yet?The  Metaverse:    Are   We  There  Yet?
The Metaverse: Are We There Yet?
 
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
 
Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...
 
Breaking Down the Flutterwave Scandal What You Need to Know.pdf
Breaking Down the Flutterwave Scandal What You Need to Know.pdfBreaking Down the Flutterwave Scandal What You Need to Know.pdf
Breaking Down the Flutterwave Scandal What You Need to Know.pdf
 
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
 
Microsoft CSP Briefing Pre-Engagement - Questionnaire
Microsoft CSP Briefing Pre-Engagement - QuestionnaireMicrosoft CSP Briefing Pre-Engagement - Questionnaire
Microsoft CSP Briefing Pre-Engagement - Questionnaire
 
Where to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdfWhere to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdf
 
Structuring Teams and Portfolios for Success
Structuring Teams and Portfolios for SuccessStructuring Teams and Portfolios for Success
Structuring Teams and Portfolios for Success
 
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptxHarnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
 
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdfSimplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
 
Introduction to FIDO Authentication and Passkeys.pptx
Introduction to FIDO Authentication and Passkeys.pptxIntroduction to FIDO Authentication and Passkeys.pptx
Introduction to FIDO Authentication and Passkeys.pptx
 
Overview of Hyperledger Foundation
Overview of Hyperledger FoundationOverview of Hyperledger Foundation
Overview of Hyperledger Foundation
 

Featured

Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 

Featured (20)

Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
 

How you can Get WooCommerce Order Details?

  • 1. How to Get WooCommerce Order Details? As we know that, WooCommerce is the most popular platform for eCommerce solutions, and it already has by default templates of each page with the default template design. So, sometimes we want to change the design of the template with our custom template and in that template, we need order details to show as per custom design. Let’s get started. Get WooCommerce Order Details We have to send in the custom email body content. So there, we have to use the WC_Order object to get WooCommerce order details. We can also use the wc_get_orders(), this is function to get the order object and get the order details on certain parameter. RECENT POSTS CATEGORIES MOST VIEWED POSTS FOLLOW US Stay updated via social channels HOW TO WOOCOMMERCE WORDPRESS Blog Categories  Tips & Tricks Contact  HOME WOOCOMMERCE HOW TO GET WOOCOMMERCE ORDER DETAILS? AMAN MEHRA FEBRUARY 27, 2021 LEAVE A COMMENT Tweet on Twitter Share on Facebook How to Add WooCommerce Cart Icon in Menu with Item Count? How to Secure Password Using bcrypt in PHP? How to Make a DataTable in ReactJS? How to Inline Style in ReactJS? How to Install WordPress Theme (2021 Edition)? How To PHP ReactJS Tips & Tricks WooCommerce WordPress WooCommerce Remove Update Cart Button and Make it Automatically Update. October 5, 2020 How to Change Price of Speci c Product and Quantity in Cart? October 14, 2020 How to Redirect to Checkout After Add to Cart? October 16, 2020 How can I Prevent SQL Injection in PHP? October 7, 2020 Upload Multiple Featured Images in a Post OR Page January 4, 2021 $order_id = 145; $order = new WC_Order( $order_id ); //$order = wc_get_order( $order_id ); $orderid = $order->get_id(); // Get the order ID $parent_id = $order->get_parent_id(); // Get the parent $user_id = $order->get_user_id(); // Get the user ID $user = $order->get_user(); // Get the WP_User obje // Get Order Status $order_status = $order->get_status(); // Get the order // Get Order Dates $date_created = $order->get_date_created(); // Get date $date_modified = $order->get_date_modified(); // Get dat $date_completed = $order->get_date_completed(); // Get o $date_paid = $order->get_date_paid(); //Get order paid d //Get Order Billing Details $billing_first_name = $order->get_billing_first_name(); $billing_last_name = $order->get_billing_last_name(); $billing_company = $order->get_billing_company(); $billing_address1 = $order->get_billing_address_1(); $billing_address2 = $order->get_billing_address_2(); $billing_city = $order->get_billing_city(); 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
  • 2. So, we see how to get WooCoomerce order details with the help of getter method. You can check more method here. If you want to get and access the protected data of the order object then, you can use the get_data() function. It is the same as we did above with the instance of the $order object. E.g: $order->get_data() It will return the data as an associative array and we can use this array with key=>pair value. Let’s see the example. $billing_state = $order->get_billing_state(); $billing_postcode = $order->get_billing_postcode(); $billing_country = $order->get_billing_country(); $billing_email = $order->get_billing_email(); $billing_phone = $order->get_billing_phone(); $billing_formatted_name = $order->get_formatted_billing_ $billing_formatted_address = $order->get_formatted_billi //Get Order Shipping Details $shipping_first_name = $order->get_shipping_first_name( $shipping_last_name = $order->get_shipping_last_name(); $shipping_company = $order->get_shipping_company(); $shipping_address1 = $order->get_shipping_address_1(); $shipping_address2 = $order->get_shipping_address_2(); $shipping_city = $order->get_shipping_city(); $shipping_state = $order->get_shipping_state(); $shipping_postcode = $order->get_shipping_postcode(); $shipping_country = $order->get_shipping_country(); $shipping_formatted_name = $order->get_formatted_shippin $shipping_formatted_address = $order->get_formatted_ship //Get Order Payment Details $currency = $order->get_currency(); // Get the curr $payment_title = $order->get_payment_method_title(); // $payment_method = $order->get_payment_method(); // Get t $fees = $order->get_fees(); // Get the order fees $subtotal = $order->get_subtotal(); // Get the order sub $total_tax = $order->get_total_tax(); // Get the order t $total = $order->get_total(); // Get the order total $order_id = 145; $order = wc_get_order( $order_id ); $order_data = $order->get_data(); // Get the Order data $orderid = $order_data['id']; // Get the order ID $parent_id = $order_data['parent_id']; // Get the parent // Get Order Status $order_status = $order_data['status']; // Get the order // Get Order Dates $date_created = $order_data['date_created']; // Get dat $date_modified = $order_data['date_modified']; // Get da $date_completed = $order_data['date_completed']; // Get $date_paid = $order_data['date_paid']; //Get order paid //Get Order Billing Details $billing_first_name = $order_data['billing']['first_name $billing_last_name = $order_data['billing']['last_name' $billing_company = $order_data['billing']['company']; $billing_address1 = $order_data['billing']['address_1'] $billing_address2 = $order_data['billing']['address_2'] $billing_city = $order_data['billing']['city']; $billing_state = $order_data['billing']['state']; $billing_postcode = $order_data['billing']['postcode']; $billing_country = $order_data['billing']['country']; $billing_email = $order_data['billing']['email']; $billing_phone = $order_data['billing']['phone']; 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
  • 3. How to Add WooCommerce Cart Icon in Menu with Item Count? How to Secure Password Using bcrypt in PHP? With the get_data() function you can use order data as a array properties for get WooCommerce order details. You can also loop the order items with get_items() function, if you have multiple items in one order. See the simple example to understand this. Here, we loop the order items and get the value with getter method, as we used in above. So in this article we work with: WC_Order wc_get_order() get_data() get_items() I hope you understand! how to get WooCommerce order details and use it? YOU MAY ALSO LIKE GET ORDER DETAILS  WOOCOMMERCE ORDER  WOOCOMMERCE ORDER DETAILS  Tweet on Twitter Share on Facebook //Get Order Shipping Details $shipping_first_name = $order_data['shipping']['first_na $shipping_last_name = $order_data['shipping']['last_name $shipping_company = $order_data['shipping']['company']; $shipping_address1 = $order_data['shipping']['address_1 $shipping_address2 = $order_data['shipping']['address_2 $shipping_city = $order_data['shipping']['city']; $shipping_state = $order_data['shipping']['state']; $shipping_postcode = $order_data['shipping']['postcode' $shipping_country = $order_data['shipping']['country']; //Get Order Payment Details $subtotal = $order_data['subtotal']; // Get the order su $total_tax = $order_data['total_tax']; // Get the order $total = $order_data['total']; // Get the order total foreach ( $order->get_items() as $item_id => $item ) { $product = $item->get_product(); $product_id = $item->get_product_id(); $variation_id = $item->get_variation_id(); $name = $item->get_name(); $quantity = $item->get_quantity(); $subtotal = $item->get_subtotal(); $total = $item->get_total(); $tax = $item->get_subtotal_tax(); $all_meta = $item->get_meta_data(); $single_meta = $item->get_meta( '_meta_key', true ); $type = $item->get_type(); //and so on... } 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
  • 4. How to Make a DataTable in ReactJS? How to Inline Style in ReactJS? How to Install WordPress Theme (2021 Edition)? How to Install WordPress – Beginners Guide? Name * Email * Website ABOUT THE AUTHOR: AMAN MEHRA Hey! I'm Aman Mehra and I'm a full-stack developer and have 5+ years of experience. I love coding and nd solutions to bugs. LEAVE A REPLY Your email address will not be published. Required elds are marked * Comment Save my name, email, and website in this browser for the next time I comment. © 2020 Your Blog Coach Privacy Policy Terms and Conditions Sitemap POST COMMENT ABOUT Your Blog Coach is the best site for nding the solution to any issue related to coding and learn more cool stuff and tricks. QUICK LINKS Blog WordPress WooCommerce Contact RECENT POSTS How to Add WooCommerce Cart Icon in Menu with Item Count? How to Secure Password Using bcrypt in PHP? How to Make a DataTable in ReactJS? JOIN OUR NEWSLETTER Name Email SUBSCRIBE