Customiser le Dashboard

  • Posts: 61
  • Thank you received: 6
  • Hikaserial Standard Hikashop Essential
9 months 2 weeks ago #359634

-- HikaShop version -- : 5.0.3
-- Joomla version -- : 4.4.3
-- PHP version -- : 8.1.27

Bonjour,

Je ne vois pas comment customiser le dasboard…

To display a report on your dashboard, simply publish it through the listing or the report edition screen.


J'ai supprimé les rapports inutiles, créé et activé les rapports dont j'ai besoin : rien ne change dans le dasboard

according to the options your set in the global configuration of Hikashop


Rien de cela dans la config globale

Comment doit-on s'y prendre ?
Merci

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

  • Posts: 83022
  • Thank you received: 13403
  • MODERATOR
9 months 2 weeks ago #359635

Bonjour,

HikaShop dispose de 2 dashboards:
- Le premier est celui par défaut qui ne dispose pas d'interface de personnalisation. Il est possible de le personnalisé en développant un plugin HikaShop implémentant l'évènement onBeforeStatisticsLoad:
www.hikashop.com/support/documentation/6...BeforeStatisticsLoad
Bien que cela permet de faire beaucoup de choses et que c'est très puissant, il faut faire appel à un développeur PHP pour cela.

- Le second dashboard est en fait l'ancien dashboard par défaut d'HikaShop qui était le seul du backend d'HikaShop avant HikaShop 3. Ce dashboard se base sur les rapports pour générer des widgets. Celui-ci est complètement personnalisable via le menu Commandes>Rapports, mais vous êtes limité par les options proposées par l'interface.

Pour passer d'un dashboard à l'autre, vous avez l'option "dashboard legacy" (dashboard obsolète je crois en Français?) dans l'onglet "Avancés" de la configuration HikaShop.

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

  • Posts: 61
  • Thank you received: 6
  • Hikaserial Standard Hikashop Essential
9 months 1 week ago #359647

Bonjour,
Ok merci, le dashboard legacy fera l'affaire. Dommage quand même que le module dashboard ne suive pas le choix de type de dashboard.
Cordialement

edit : sorry, I've just seen that I've written in french in the english speaking part of the forum.
Feel free to put this thread in the relevant part if you want!

Last edit: 9 months 1 week ago by marcmarc.
The following user(s) said Thank You: nicolas

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

  • Posts: 61
  • Thank you received: 6
  • Hikaserial Standard Hikashop Essential
1 month 2 days ago #364551

Hi,
The old dashboard has been enough so far, but I would like to use the new dashboard now.
The problem is that I want to display many reports that are not present and delete some of the ones that are there.

In your answer a few months ago, you said "It is possible to customize it by developing a HikaShop plugin implementing the onBeforeStatisticsLoad event: www.hikashop.com/support/documentation/6...BeforeStatisticsLoad . Although this allows you to do a lot of things and is very powerful, you need a PHP developer for this."
Since I have developed plugins for Hikashop and Hikaserial I think I can try but I need a little more information…

I don't see any existing plugin that generates the dashboard as is, so I don't have an example of how to do it. Can you point me in the right direction?

Thanks

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

  • Posts: 83022
  • Thank you received: 13403
  • MODERATOR
1 month 2 days ago #364564

Hi,

In your custom plugin, you can implement the event like so:

public function onBeforeStatisticsLoad(&$data) {
 echo '<pre>';
 var_dump($data);
 echo '</pre>';
}
That will display the data used by HikaShop to generate the new dashboard.
You can then directly modify the content of the $data variable in order to adapt it to your needs.

In $data, you have access to the placement of each block, the formatting, the elements to build the MySQL query to load the data, etc.

For example, if you want to change the title "Last orders" of the section with the list of the latest orders, you could use:
$data['last_orders']['label'] = 'Custom label';
Or if you wanted the orders of that listing to be loaded based on the "order_invoice_created" column instead of the "order_created" column, you could add:
$data['last_orders']['query']['order'] = 'hk_order.order_invoice_created DESC';
Or if you wanted this area to use the whole width on big screens, you could add:
$data['last_orders']['class'] = 'hkc-lg-12 hkc-sm-12';
Basically, you have all the latitude to build your own dashboard, or do small tweaks here and there.

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

Time to create page: 0.067 seconds
Powered by Kunena Forum