custom SQL query visualizacion in backend menu

  • Posts: 2
  • Thank you received: 0
12 years 5 months ago #50106

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.

  • Posts: 82723
  • Thank you received: 13338
  • MODERATOR
12 years 5 months ago #50162

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.

  • Posts: 46
  • Thank you received: 3
7 years 11 months ago #256081

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.

  • Posts: 82723
  • Thank you received: 13338
  • MODERATOR
7 years 11 months ago #256090

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.

  • Posts: 46
  • Thank you received: 3
7 years 11 months ago #256116

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.

  • Posts: 26150
  • Thank you received: 4026
  • MODERATOR
7 years 11 months ago #256139

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.073 seconds
Powered by Kunena Forum