Skip to main content

Extracting info on individual purchases

More
14 years 5 months ago #49412 by abasel
We are using HikaShop to sell tickets for Jubilee functions. When I export the sales I get everything in one spreadsheet which is difficult to extract data from.

I am needing a method of pulling a list of who purchased a particular product e.g. a list of all people who bought dinner tickets or a list of all people who purchased Jubilee booklets. At the very least I need the MySQL code to do this.

Please Log in or Create an account to join the conversation.

More
14 years 4 months ago #49451 by nicolas
You can run a query like that:
SELECT d.name FROM jos_hikashop_order_product AS a LEFT JOIN jos_hikashop_order AS b ON a.order_id=b.order_id LEFT JOIN jos_hikashop_user AS c ON b.order_user_id=c.user_id LEFT JOIN jos_users AS d ON c.user_cms_id=d.id WHERE a.order_product_code = 'DINNER_TICKET'

Please Log in or Create an account to join the conversation.

More
14 years 4 months ago #49493 by abasel
Thanks for that, I did the following:
Code:
SELECT d.name FROM jos_hikashop_order_product AS a LEFT JOIN jos_hikashop_order AS b ON a.order_id=b.order_id LEFT JOIN jos_hikashop_user AS c ON b.order_user_id=c.user_id LEFT JOIN jos_users AS d ON c.user_cms_id=d.id WHERE a.order_product_code = 'Jubilee Dinner'

But got zero rows returned even though there should have been about 75.

Please Log in or Create an account to join the conversation.

More
14 years 4 months ago #49565 by nicolas
The product code does not contain any space if generated automatically.

Are you sure that the code of your product is "Jubilee Dinner" ? Isn't that the name of your product instead ?

Please Log in or Create an account to join the conversation.

More
14 years 4 months ago #49612 by abasel
Oops... yes I used the description :blush:

Please Log in or Create an account to join the conversation.

Time to create page: 0.202 seconds
Powered by Kunena Forum