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

#   Retrieve serials onAfterOrderUpdate trigger

##

- **[tcpinnovation](/forum/user/52563-tcpinnovation "View tcpinnovation's Profile")**
- [![tcpinnovation's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar52563.jpg)](/forum/user/52563-tcpinnovation "View tcpinnovation's Profile") Topic Author
- [ Offline](/forum/user/52563-tcpinnovation)

Less More

- Posts: 17
- Thank you received: 1
-
-
-
- [](http://www.tcp-innovation.fr)
-

8 years 9 months ago -  8 years 9 months ago [\#288245](#288245) by [tcpinnovation](/forum/user/52563-tcpinnovation "View tcpinnovation's Profile")  *[Retrieve serials onAfterOrderUpdate trigger](/forum/35-orders-management/893851-retrieve-serials-onafterorderupdate-trigger#288245 "-- HikaShop version -- : 3.2.2 -- Joomla version -- : 3.8.5 -- PHP version -- : 7.2.2 -- Browser(s) name and version -- : 64.0.3282.167  Hi,  I'm trying to develop an Hikashop plugin that sends the product ids and the serials attached to an external webservice whenever an order is confirmed (i'm using the onAfterOrderUpdate trigger because the onAfterConfirmOrder trigger is not called if a coupon is used to have a free product).  The issue is that in the $order object passed in the trigger, the serial data is still completely empty. It seems that the assignSerial method used by Hikaserial is called after the Hikashop plugins are called.  How can i properly retrieve the serials in an order in a Hikashop plugin (not hikaserial) with the trigger onAfterOrderUpdate ?  Thank you in advance for your response.")* was created by *[tcpinnovation](/forum/user/52563-tcpinnovation "View tcpinnovation's Profile")*

-- HikaShop version -- : 3.2.2
-- Joomla version -- : 3.8.5
-- PHP version -- : 7.2.2
-- Browser(s) name and version -- : 64.0.3282.167

Hi,

I'm trying to develop an Hikashop plugin that sends the product ids and the serials attached to an external webservice whenever an order is confirmed (i'm using the *onAfterOrderUpdate* trigger because the *onAfterConfirmOrder* trigger is not called if a coupon is used to have a free product).

The issue is that in the *$order* object passed in the trigger, the serial data is still completely empty. It seems that the *assignSerial* method used by Hikaserial is called after the Hikashop plugins are called.

How can i properly retrieve the serials in an order in a Hikashop plugin (not hikaserial) with the trigger *onAfterOrderUpdate* ?

Thank you in advance for your response.

Last edit: 8 years 9 months ago by [tcpinnovation](/forum/user/52563-tcpinnovation "View tcpinnovation's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM1LW9yZGVycy1tYW5hZ2VtZW50Lzg5Mzg1MS1yZXRyaWV2ZS1zZXJpYWxzLW9uYWZ0ZXJvcmRlcnVwZGF0ZS10cmlnZ2VyP3RtcGw9bWFya2Rvd24=) 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?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86581
- Thank you received: 14322
-
-

8 years 9 months ago [\#288249](#288249) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Retrieve serials onAfterOrderUpdate trigger](/forum/35-orders-management/893851-retrieve-serials-onafterorderupdate-trigger#288249 "-- HikaShop version -- : 3.2.2 -- Joomla version -- : 3.8.5 -- PHP version -- : 7.2.2 -- Browser(s) name and version -- : 64.0.3282.167  Hi,  I'm trying to develop an Hikashop plugin that sends the product ids and the serials attached to an external webservice whenever an order is confirmed (i'm using the onAfterOrderUpdate trigger because the onAfterConfirmOrder trigger is not called if a coupon is used to have a free product).  The issue is that in the $order object passed in the trigger, the serial data is still completely empty. It seems that the assignSerial method used by Hikaserial is called after the Hikashop plugins are called.  How can i properly retrieve the serials in an order in a Hikashop plugin (not hikaserial) with the trigger onAfterOrderUpdate ?  Thank you in advance for your response.")*

Hi,

The trigger onAfterOrderConfirm is triggered when the customer click on the finish button at the end of the checkout. It's mainly used by payment plugins to redirect the customer to the payment gateway.

So you indeed want to use the trigger onAfterOrderUpdate in your case.
Note that in that function $order contains only the information that is being modified by the call to the save function of class.order.
So it's normal that it doesn't contain all the information of the order.
You would have to add such code to get all the data:
$orderClass= hikashop_get('class.order');
$orderInDB = $orderClass-&gt;loadFullOrder($order-&gt;order_id);
Note however that even $orderInDB should not have the data of the serials. You would have to run a MySQL query to load them yourself.
And note also that you need to configure the ordering of your plugin to be greater than the HikaShop - HikaSerial plugin in the Joomla plugins manager so that HikaSerial can add the serials to the order in the database before your plugin is triggered.

The following user(s) said Thank You: [tcpinnovation](/forum/user/52563-tcpinnovation "View tcpinnovation's Profile")

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

- **[tcpinnovation](/forum/user/52563-tcpinnovation "View tcpinnovation's Profile")**
- [![tcpinnovation's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar52563.jpg)](/forum/user/52563-tcpinnovation "View tcpinnovation's Profile") Topic Author
- [ Offline](/forum/user/52563-tcpinnovation)

Less More

- Posts: 17
- Thank you received: 1
-
-
-
- [](http://www.tcp-innovation.fr)
-

8 years 9 months ago [\#288322](#288322) by [tcpinnovation](/forum/user/52563-tcpinnovation "View tcpinnovation's Profile")  Replied by *[tcpinnovation](/forum/user/52563-tcpinnovation "View tcpinnovation's Profile")* on topic *[Retrieve serials onAfterOrderUpdate trigger](/forum/35-orders-management/893851-retrieve-serials-onafterorderupdate-trigger#288322 "-- HikaShop version -- : 3.2.2 -- Joomla version -- : 3.8.5 -- PHP version -- : 7.2.2 -- Browser(s) name and version -- : 64.0.3282.167  Hi,  I'm trying to develop an Hikashop plugin that sends the product ids and the serials attached to an external webservice whenever an order is confirmed (i'm using the onAfterOrderUpdate trigger because the onAfterConfirmOrder trigger is not called if a coupon is used to have a free product).  The issue is that in the $order object passed in the trigger, the serial data is still completely empty. It seems that the assignSerial method used by Hikaserial is called after the Hikashop plugins are called.  How can i properly retrieve the serials in an order in a Hikashop plugin (not hikaserial) with the trigger onAfterOrderUpdate ?  Thank you in advance for your response.")*

Yes,

I figured before you answered that it would be the best choice to do an SQL request.

Thanks anyway !

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

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