- Posts: 74
- Thank you received: 7
Customiser le Dashboard
2 years 6 months ago #359634
by marcmarc
Customiser le Dashboard was created by marcmarc
-- HikaShop version -- : 5.0.3
-- Joomla version -- : 4.4.3
-- PHP version -- : 8.1.27
Bonjour,
Je ne vois pas comment customiser le dasboard…
J'ai supprimé les rapports inutiles, créé et activé les rapports dont j'ai besoin : rien ne change dans le dasboard
Rien de cela dans la config globale
Comment doit-on s'y prendre ?
Merci
-- 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.
2 years 6 months ago #359635
by nicolas
Replied by nicolas on topic Customiser le Dashboard
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.
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.
2 years 6 months ago - 2 years 6 months ago #359647
by marcmarc
Replied by marcmarc on topic Customiser le Dashboard
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!
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: 2 years 6 months ago by marcmarc.
The following user(s) said Thank You: nicolas
Please Log in or Create an account to join the conversation.
1 year 10 months ago #364551
by marcmarc
Replied by marcmarc on topic Customiser le Dashboard
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
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.
1 year 10 months ago #364564
by nicolas
Replied by nicolas on topic Customiser le Dashboard
Hi,
In your custom plugin, you can implement the event like so:
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:
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:
Or if you wanted this area to use the whole width on big screens, you could add:
Basically, you have all the latitude to build your own dashboard, or do small tweaks here and there.
In your custom plugin, you can implement the event like so:
Code:
public function onBeforeStatisticsLoad(&$data) {
echo '<pre>';
var_dump($data);
echo '</pre>';
}
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:
Code:
$data['last_orders']['label'] = 'Custom label';
Code:
$data['last_orders']['query']['order'] = 'hk_order.order_invoice_created DESC';
Code:
$data['last_orders']['class'] = 'hkc-lg-12 hkc-sm-12';
Please Log in or Create an account to join the conversation.
Time to create page: 0.180 seconds