[Skip to main content](#vessel-content)

#   plugin that gets activated when a order is created

##

- **[diesel1984](/forum/user/30999-diesel1984 "View diesel1984's Profile")**
- [![diesel1984's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/30999-diesel1984 "View diesel1984's Profile") Topic Author
- [ Offline](/forum/user/30999-diesel1984)

Less More

- Posts: 32
- Thank you received: 0
-
-

11 years 6 months ago [\#201167](#201167) by [diesel1984](/forum/user/30999-diesel1984 "View diesel1984's Profile")  *[plugin that gets activated when a order is created](/forum/27-checkout/876865-plugin-that-gets-activated-when-a-order-is-created#201167 "-- HikaShop version -- : 2.3.1 -- Joomla version -- : 2.5 -- PHP version -- : 5  Hi,  I am trying to write a custom plugin that gets activated whenever an order is created. However, the plugin function is simply not executing during the checkout process. So basically right before i get redirected to the payment gateway, the order is created in the system (i can see it in the backend of hikashop). However, the onAfterOrderCreate() function is not executing at this point - if this is how hikashop is setup, then what plugin event (function) can i call upon that will execute at this point? I am then taken off to the payment gateway - but i stop at this point because i dont want to put a payment through the system. Can anyone see the reason why this is happening? The plugin is installed and its been enabled...  &#92;plugins&#92;hikashoppayment&#92;order&#92;order.php &#92;plugins&#92;hikashoppayment&#92;order&#92;order.xml &#92;plugins&#92;hikashoppayment&#92;order&#92;index.php  code for &#92;plugins&#92;hikashoppayment&#92;order&#92;order.php Code: ?php  class plgHikashopOrder extends hikashopPaymentPlugin {  public function onAfterOrderCreate(&amp;$order,&amp;$send&#95;email) {   print('ok'); exit();   //i did initially try some database statements here but they didnt work either   //so i can only assume that this plugin event is not executing   }  }  Thanks in advance")* was created by *[diesel1984](/forum/user/30999-diesel1984 "View diesel1984's Profile")*

-- HikaShop version -- : 2.3.1
-- Joomla version -- : 2.5
-- PHP version -- : 5

Hi,

I am trying to write a custom plugin that gets activated whenever an order is created. However, the plugin function is simply not executing during the checkout process. So basically right before i get redirected to the payment gateway, the order is created in the system (i can see it in the backend of hikashop). However, the onAfterOrderCreate() function is not executing at this point - if this is how hikashop is setup, then what plugin event (function) can i call upon that will execute at this point? I am then taken off to the payment gateway - but i stop at this point because i dont want to put a payment through the system. Can anyone see the reason why this is happening? The plugin is installed and its been enabled...

\plugins\hikashoppayment\order\order.php
\plugins\hikashoppayment\order\order.xml
\plugins\hikashoppayment\order\index.php

code for \plugins\hikashoppayment\order\order.php Code:

&lt;?php /** Version: 1.0.0 Date: 20/04/2015 */ defined('_JEXEC') or die('Restricted access'); ?&gt;&lt;?php class plgHikashopOrder extends hikashopPaymentPlugin { public function onAfterOrderCreate(&amp;$order,&amp;$send_email) { print('ok'); exit(); //i did initially try some database statements here but they didnt work either //so i can only assume that this plugin event is not executing } }

Thanks in advance

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0Lzg3Njg2NS1wbHVnaW4tdGhhdC1nZXRzLWFjdGl2YXRlZC13aGVuLWEtb3JkZXItaXMtY3JlYXRlZD90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26394
- Thank you received: 4077
-
- [](http://obsi.dev)
-

11 years 6 months ago [\#201168](#201168) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[plugin that gets activated when a order is created](/forum/27-checkout/876865-plugin-that-gets-activated-when-a-order-is-created#201168 "-- HikaShop version -- : 2.3.1 -- Joomla version -- : 2.5 -- PHP version -- : 5  Hi,  I am trying to write a custom plugin that gets activated whenever an order is created. However, the plugin function is simply not executing during the checkout process. So basically right before i get redirected to the payment gateway, the order is created in the system (i can see it in the backend of hikashop). However, the onAfterOrderCreate() function is not executing at this point - if this is how hikashop is setup, then what plugin event (function) can i call upon that will execute at this point? I am then taken off to the payment gateway - but i stop at this point because i dont want to put a payment through the system. Can anyone see the reason why this is happening? The plugin is installed and its been enabled...  &#92;plugins&#92;hikashoppayment&#92;order&#92;order.php &#92;plugins&#92;hikashoppayment&#92;order&#92;order.xml &#92;plugins&#92;hikashoppayment&#92;order&#92;index.php  code for &#92;plugins&#92;hikashoppayment&#92;order&#92;order.php Code: ?php  class plgHikashopOrder extends hikashopPaymentPlugin {  public function onAfterOrderCreate(&amp;$order,&amp;$send&#95;email) {   print('ok'); exit();   //i did initially try some database statements here but they didnt work either   //so i can only assume that this plugin event is not executing   }  }  Thanks in advance")*

Hi,

If you are creating a hikashop payment plugin, the class name should be : plgHikashoppaymentOrder
The current name is for a "hikashop" plugin, not for a "hikashoppayment" one.

Regards,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0Lzg3Njg2NS1wbHVnaW4tdGhhdC1nZXRzLWFjdGl2YXRlZC13aGVuLWEtb3JkZXItaXMtY3JlYXRlZD90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.045 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
