Updates: 2017 - SQL query changed to "SELECT DISTINCT" instead of "SELECT " to avoid duplicated Order IDs in the array (then no need of ...
I'm trying to obtain all orders for particular day/time and then order products using SQL (MySQL) as seen in the query below: select p.ID as order_id, p.post_date, ...
The following custom function made with a very light unique SQL query, will get all the Orders IDs from an array of products IDs (or a unique ...
As you know, WooCommerce orders (same as WooCommerc...
The following SQL query will give you a list of product IDs purchased at least once that belongs to "clothes" product category slug: SELECT ...
Update 26 Aug 2016: By popular demand, I added a way to query for orders based on product name. Querying by product id is the right way but ...
I meant sql files.
How to retrieve all orders for a given product in WooCommerce.
' Product Name' but can you tell me how can I extract all orders done per product ID.
There are two ways of doing this: through SQL and PHP.