- Posts: 42
- Thank you received: 3
Custom Plugin in Hikashop
3 years 2 months ago #353572
by JF
Custom Plugin in Hikashop was created by JF
Hi,
May I know the correct AJAX POST URL or sample for triggering plugin in hikashop?
Thanks.
May I know the correct AJAX POST URL or sample for triggering plugin in hikashop?
Thanks.
Please Log in or Create an account to join the conversation.
3 years 2 months ago #353573
by nicolas
Replied by nicolas on topic Custom Plugin in Hikashop
Hi,
HikaShop allows for plugins to create their own controllers.
I think the email_history plugin in plugins/hikashop/email_history, which displays the menu Customers>Email history in your backend, is a good example of that. As you'll see, you need to implement the onHikashopPluginController event to register your controller. And you have the email_history_ctrl.php file which contains the controller with the tasks available.
Then, it's quite easy. For example, you can see the "listing" function in the controller, which is also registered as a task in the $display attribute of the controller class. To call it you can use the URL: index.php?option=com_hikashop&ctrl=email_history&task=listing
The only limitation to this is that you can't use a controller name which is already used in HikaShop as HikaShop's take precedence.
Also, note that you need a "views" folder in your plugin, or to add a "noview" parameter set to true when registering the controller in onHikashopPluginController.
HikaShop allows for plugins to create their own controllers.
I think the email_history plugin in plugins/hikashop/email_history, which displays the menu Customers>Email history in your backend, is a good example of that. As you'll see, you need to implement the onHikashopPluginController event to register your controller. And you have the email_history_ctrl.php file which contains the controller with the tasks available.
Then, it's quite easy. For example, you can see the "listing" function in the controller, which is also registered as a task in the $display attribute of the controller class. To call it you can use the URL: index.php?option=com_hikashop&ctrl=email_history&task=listing
The only limitation to this is that you can't use a controller name which is already used in HikaShop as HikaShop's take precedence.
Also, note that you need a "views" folder in your plugin, or to add a "noview" parameter set to true when registering the controller in onHikashopPluginController.
The following user(s) said Thank You: JF
Please Log in or Create an account to join the conversation.
Time to create page: 0.090 seconds