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

#   onAfterOrderUpdate not triggered on paypal confirm

##

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

Less More

- Posts: 4
- Thank you received: 0
-
-

11 years 2 months ago [\#210522](#210522) by [dirkey](/forum/user/34021-dirkey "View dirkey's Profile")  *[onAfterOrderUpdate not triggered on paypal confirm](/forum/31-development/878566-onafterorderupdate-not-triggered-on-paypal-confirm#210522 "-- HikaShop version -- : 2.5.0 -- Joomla version -- : 3.2.7 -- PHP version -- : 5.3.2  Hello,  We create a plugin which works &quot;perfectly&quot; :) . If the order is change to confirmed state, a email with a pdf (invoice) is created and send to the customer. There is only one issue:  If the user pays via paypal the plugin is not invoked. The order is confirmed, but it seems not to trigger the plugin. If I change the state back to open (in the backend) and back to confirmed, the trigger is invoked.  Thanks for help, Dirk")* was created by *[dirkey](/forum/user/34021-dirkey "View dirkey's Profile")*

-- HikaShop version -- : 2.5.0
-- Joomla version -- : 3.2.7
-- PHP version -- : 5.3.2

Hello,

We create a plugin which works "perfectly" ![:)](/media/kunena/emoticons/8.png ":)") . If the order is change to confirmed state, a email with a pdf (invoice) is created and send to the customer. There is only one issue:

If the user pays via paypal the plugin is not invoked. The order is confirmed, but it seems not to trigger the plugin. If I change the state back to open (in the backend) and back to confirmed, the trigger is invoked.

Thanks for help,
Dirk

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMxLWRldmVsb3BtZW50Lzg3ODU2Ni1vbmFmdGVyb3JkZXJ1cGRhdGUtbm90LXRyaWdnZXJlZC1vbi1wYXlwYWwtY29uZmlybT90bXBsPW1hcmtkb3du) 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: 4078
-
- [](http://obsi.dev)
-

11 years 2 months ago [\#210533](#210533) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[onAfterOrderUpdate not triggered on paypal confirm](/forum/31-development/878566-onafterorderupdate-not-triggered-on-paypal-confirm#210533 "-- HikaShop version -- : 2.5.0 -- Joomla version -- : 3.2.7 -- PHP version -- : 5.3.2  Hello,  We create a plugin which works &quot;perfectly&quot; :) . If the order is change to confirmed state, a email with a pdf (invoice) is created and send to the customer. There is only one issue:  If the user pays via paypal the plugin is not invoked. The order is confirmed, but it seems not to trigger the plugin. If I change the state back to open (in the backend) and back to confirmed, the trigger is invoked.  Thanks for help, Dirk")*

Hi,

The paypal plugin works like a lot of other payment plugin ; it receives a notification (IPN) to confirm the order.
At this moment the plugin will modify the order and it will trigger the trigger "onAfterOrderUpdate".
Because it's not the user who confirmed his order, you can't see it in your browser ; the confirmation is made during a server-to-server call.
But in any case, the trigger is called !

Regards,

---

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

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

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

Less More

- Posts: 4
- Thank you received: 0
-
-

11 years 2 months ago -  11 years 2 months ago [\#210926](#210926) by [dirkey](/forum/user/34021-dirkey "View dirkey's Profile")  Replied by *[dirkey](/forum/user/34021-dirkey "View dirkey's Profile")* on topic *[onAfterOrderUpdate not triggered on paypal confirm](/forum/31-development/878566-onafterorderupdate-not-triggered-on-paypal-confirm#210926 "-- HikaShop version -- : 2.5.0 -- Joomla version -- : 3.2.7 -- PHP version -- : 5.3.2  Hello,  We create a plugin which works &quot;perfectly&quot; :) . If the order is change to confirmed state, a email with a pdf (invoice) is created and send to the customer. There is only one issue:  If the user pays via paypal the plugin is not invoked. The order is confirmed, but it seems not to trigger the plugin. If I change the state back to open (in the backend) and back to confirmed, the trigger is invoked.  Thanks for help, Dirk")*

Hi Jerome,

but why is the emai not created. My plugin creates a pdf invoice and sends it via email:

Some extract:
Code:

class plgHikashopAsado_invoice extends JPlugin { .... function onAfterOrderUpdate(&amp;$order, &amp;$send_email) { if ($order-&gt;order_status == 'confirmed') { $mailer = JFactory::getMailer (); // set sender &amp; recipient $mailer-&gt;setSender ( $order-&gt;mail-&gt;from_email ); .... // sending the email $send = $mailer-&gt;Send (); if ($send) { JFactory::getApplication ()-&gt;enqueueMessage ( 'A mail was send.' ); } else { JFactory::getApplication ()-&gt;enqueueMessage ( 'The billing email could not be send.', 'error' ); return false; } } }

As I mention, it works completly fine if I switch the order state in the backend.

Thanks,
Dirk

Last edit: 11 years 2 months ago by [dirkey](/forum/user/34021-dirkey "View dirkey's Profile").

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

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86290
- Thank you received: 14268
-
-

11 years 2 months ago [\#210929](#210929) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[onAfterOrderUpdate not triggered on paypal confirm](/forum/31-development/878566-onafterorderupdate-not-triggered-on-paypal-confirm#210929 "-- HikaShop version -- : 2.5.0 -- Joomla version -- : 3.2.7 -- PHP version -- : 5.3.2  Hello,  We create a plugin which works &quot;perfectly&quot; :) . If the order is change to confirmed state, a email with a pdf (invoice) is created and send to the customer. There is only one issue:  If the user pays via paypal the plugin is not invoked. The order is confirmed, but it seems not to trigger the plugin. If I change the state back to open (in the backend) and back to confirmed, the trigger is invoked.  Thanks for help, Dirk")*

Hi,

I don't see any reason why it wouldn't work if it works on the backend. We have many plugins which use that method in order to do things when an order is confirmed.
We actually already have a PDF invoice plugin which works like that:
[ hikashop.com/component/hikashop/product/cid-18.html](https://hikashop.com/component/hikashop/product/cid-18.html)
You must have an issue somewhere in the code of the plugin with something which can only work in the backend, not the frontend.
For example, if you're using the loadFullOrder function call in order to load the details of the order, this will always work in the backend, but on the frontend, as the user loading the order is not the customer but the PayPal notification server, you need to add additional parameters when calling it in order to disable the check on the current user.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMxLWRldmVsb3BtZW50Lzg3ODU2Ni1vbmFmdGVyb3JkZXJ1cGRhdGUtbm90LXRyaWdnZXJlZC1vbi1wYXlwYWwtY29uZmlybT90bXBsPW1hcmtkb3du) 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.170 seconds

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

[](#top)
