This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- Export Active and Canceled Subscriptions (HPOS Compatible) | |
| -- Adjust the table prefix 'wp_' if your database uses a different one, though 'wp_' was detected in wp-config.php. | |
| SELECT | |
| o.id AS subscription_id, | |
| o.status AS subscription_status, | |
| o.date_created_gmt AS date_created, | |
| a.first_name, | |
| a.last_name, | |
| a.email, | |
| o.total_amount, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SELECT | |
| o.id AS Order_ID, | |
| o.status AS Order_Status, -- Added Order Status here | |
| o.date_created_gmt AS Order_Date, | |
| a.email AS Billing_Email, | |
| ( | |
| SELECT GROUP_CONCAT(order_item_name SEPARATOR ' | ') | |
| FROM wp_woocommerce_order_items oi | |
| WHERE oi.order_id = o.id | |
| AND oi.order_item_type = 'line_item' |