- Posts: 139
- Thank you received: 1
Extracting info on individual purchases
14 years 5 months ago #49412
by abasel
Extracting info on individual purchases was created 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.
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.
14 years 4 months ago #49451
by nicolas
Replied by nicolas on topic Re: Extracting info on individual purchases
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'
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.
14 years 4 months ago #49493
by abasel
Replied by abasel on topic Re: Extracting info on individual purchases
Thanks for that, I did the following:
But got zero rows returned even though there should have been about 75.
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.
14 years 4 months ago #49565
by nicolas
Replied by nicolas on topic Re: Extracting info on individual purchases
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 ?
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.
14 years 4 months ago #49612
by abasel
Replied by abasel on topic Re: Extracting info on individual purchases
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