Don't ignore because i am from Bangladesh, I have many positive reviews as a buyer.
Hi,
I am trying to write a mysql query that will check the total quantity of a product someone purchased in a woocommerce website.
So far i wrote this.
$nsql = "SELECT COUNT([login to view URL]) FROM wpwe_posts AS p
INNER JOIN wpwe_postmeta AS pm ON [login to view URL] = pm.post_id
INNER JOIN wpwe_woocommerce_order_items AS woi ON [login to view URL] = woi.order_id
INNER JOIN wpwe_woocommerce_order_itemmeta AS woim ON woi.order_item_id = woim.order_item_id
WHERE p.post_status IN ( 'wc-completed' )
AND pm.meta_key = '_customer_user'
AND pm.meta_value = $customer_id
AND woim.meta_key IN ( '_product_id', '_variation_id' )
AND woim.meta_value IN ($product_ids)
";
This shows how many times the product was purchased by the customer but not the sum of the quantity.
I need the sum of the _qty , see screenshot.
If you know mysql, this can be a easy project for you. I am ready to pay 30$ for this work.
Hi, I can do this for you.
I have many experience working with MySQL Databases.
I'm also about to graduate as a Computeer Engenieer.
I can do it at a very low cost because I'm new at freelancer and I want to have some good reviews.
Chat me and We can talk about this whenever you want.
Hope We can work together.