Where does woocommerce purchase orders go?

I look in sql db and I see something that resembles orders inside wp_posts. However, I would expect them to be inside tables starting with wp_woocommerce.

Can anyone shed light on this phenomenon?

Greetings

+5
source share
5 answers

I can confirm that woocommerce orders are a custom message type, so they are stored in wp_posts at your discretion.

+5
source

Updated version version 8/8/2015

Orders are a custom message type. From WooCommerce Post Types :

  • Store order (shop_order)

Orders live in the wp_posts table ( post_type = 'shop_order' ). Additional data is available by looking at the post_id order in the wp_postmeta table.

In addition, WooCommerce Installed Database Tables

  • woocommerce_order_items - order items are stored in a table to make them easily accessible for reports
  • woocommerce_order_itemmeta strong>. The metal of the order item is placed in the table to store additional data.

The current version of WordPress is WooCommerce version 2.4.x

+5
source

WooCommerce orders are "custom posts", they are stored in "wp_posts" under "post_type" → "shop_order"

if you want to select a store order using an SQL query, you can do something like below.

 global $wpdb; $results = $wpdb->get_results( "SELECT * FROM $wpdb->posts WHERE post_type = 'shop_order'", ARRAY_A ); 
+3
source
 wp_woocommerce_order_itemmeta wp_woocommerce_order_items wp_posts 

Depending on the type of data you are looking for, you need to search in different places. If you have PHPMyAdmin, try finding the data you need.

0
source

I recently recovered order data manually, and here is the table I found.

 wp_posts //post_type = shop_order wp_postmeta wp_woocommerce_order_items wp_woocommerce_order_itemmeta 

Make sure the order_id / order_item_id link is correct for postmeta and itemmeta.

0
source

All Articles