Custom Plugin in Hikashop

  • Posts: 42
  • Thank you received: 3
1 year 4 months ago #353572

Hi,

May I know the correct AJAX POST URL or sample for triggering plugin in hikashop?

Thanks.

Attachments:

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
1 year 4 months ago #353573

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.

The following user(s) said Thank You: JF

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

Time to create page: 0.057 seconds
Powered by Kunena Forum