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

#   Execute specific files or functions

##

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

Less More

- Posts: 15
- Thank you received: 0
-
-

13 years 4 months ago [\#110379](#110379) by [Teonnyn](/forum/user/8708-teonnyn "View Teonnyn's Profile")  *[Execute specific files or functions](/forum/4-how-to/84023-execute-specific-files-or-functions#110379 "Is it possible to execute specific functions after purchase of certain items - IE, in order to create a digital item shop? I'd like to be able to create a system that allows people to buy items that get added to their players database/inventory system.")* was created by *[Teonnyn](/forum/user/8708-teonnyn "View Teonnyn's Profile")*

Is it possible to execute specific functions after purchase of certain items - IE, in order to create a digital item shop?
I'd like to be able to create a system that allows people to buy items that get added to their players database/inventory system.

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

13 years 4 months ago [\#110380](#110380) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Execute specific files or functions](/forum/4-how-to/84023-execute-specific-files-or-functions#110380 "Is it possible to execute specific functions after purchase of certain items - IE, in order to create a digital item shop? I'd like to be able to create a system that allows people to buy items that get added to their players database/inventory system.")*

Yes, you can create a hikashop plugin and implement the onAfterOrderUpdate trigger and check the order_status of the order in it and if it is confirmed, then you can do the processing you need:
[ www.hikashop.com/en/support/documentatio...l#onAfterOrderUpdate](http://www.hikashop.com/en/support/documentation/62-hikashop-developer-documentation.html#onAfterOrderUpdate)

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

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

Less More

- Posts: 15
- Thank you received: 0
-
-

13 years 4 months ago [\#110408](#110408) by [Teonnyn](/forum/user/8708-teonnyn "View Teonnyn's Profile")  Replied by *[Teonnyn](/forum/user/8708-teonnyn "View Teonnyn's Profile")* on topic *[Execute specific files or functions](/forum/4-how-to/84023-execute-specific-files-or-functions#110408 "Is it possible to execute specific functions after purchase of certain items - IE, in order to create a digital item shop? I'd like to be able to create a system that allows people to buy items that get added to their players database/inventory system.")*

What would be the best way to check if it's certain products - dynamically if possible? For instance, a T-shirt shouldn't trigger an "Add to Inventory" command but a in-game credit purchase should.

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

13 years 4 months ago [\#110418](#110418) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Execute specific files or functions](/forum/4-how-to/84023-execute-specific-files-or-functions#110418 "Is it possible to execute specific functions after purchase of certain items - IE, in order to create a digital item shop? I'd like to be able to create a system that allows people to buy items that get added to their players database/inventory system.")*

In the $order variable, you will get he id of the order like that:
$order-&gt;order_id

So you can simply load the full order like that:
$class = hikashop_get('class.order');
$fullOrder = $class-&gt;loadFullOrder($order-&gt;order_id);

and then loop on the products list to check the products:
foreach($fullOrder-&gt;products as $product){
if($product-&gt;order_product_code=='in-game credit product code'){
//custom code
}
}

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

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

[](#top)
