Skip to main content

custom SQL query visualizacion in backend menu

More
14 years 4 months ago #50106 by jorishikashop
Hi,

1st of all, it works great, you made me happy so far.

2nd I would like to to add a custom report on SUMS of currently "created" and "confirmed" products to the backend menu for my client. So my client knows what to order in bulk to satisfy his open orders of his customers.

I can do a bit of coding and/or make an SQL query that does that but i would like to have one or two clues on how I am "supposed" to do this without making a mess.

Best of all, and thanks, Joris

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

More
14 years 4 months ago #50162 by nicolas
You will have to edit the file "listing" of the view "product" of the back end for your back end template via the menu Display->Views.
There, add a query to load the sum for each product and display it in the listing.

Doing it via the Display->Views will create an override and you won't loose your changes when you update HikaShop.

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

More
9 years 10 months ago #256081 by montemama
I will appreciate if you share the solution! I need the same thing. Thanks a lot in advance.

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

More
9 years 10 months ago #256090 by nicolas
Hi,

If you want a listing of the products with their sales count, you can do that now with either a report (menu Orders->Reports) or with a mass action (menu System>Mass actions).
With mass actions, you can simply have an action "display the results" with the columns product_name and product_sales selected and click on "process".
With reports, you can go further with filtering for only a period of time, only some categories, etc.

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

More
9 years 10 months ago #256116 by montemama
Thank you, Nicolas.
Is there a way to find out who ordered products? So not to display only sales (quantities), but add another column with list of order numbers?

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

More
9 years 10 months ago #256139 by Jerome
Hi,

Within a mass action it will be difficult to link the "product" with the "orders" though the "order products".
In that case it will be easier to have a custom plugin for your specific SQL query.

And with HikaShop 3, the new dashboard system allow to create reports via plugins.
That system is more flexible than the current Report system in HikaShop 2.x (and we will be able to create a bridge to also provide a nice easy interface to create simple reports) ; it gives you a possibility to write your own SQL to retrieve the data you want (and to perform the table link you need).

Now with your current request, you have to be careful on the fact that the number of column is dynamic.
More orders you will have for a products, more column it will display.

Regards,

Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

Time to create page: 0.169 seconds
Powered by Kunena Forum