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

#   Run a custom php script when order is complete

##

- **[btbjosh](/forum/user/12727-btbjosh "View btbjosh's Profile")**
- [![btbjosh's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/gallery/splatter_hand.png)](/forum/user/12727-btbjosh "View btbjosh's Profile") Topic Author
- [ Offline](/forum/user/12727-btbjosh)

Less More

- Posts: 90
- Thank you received: 1
-
-
-

13 years 6 months ago [\#97604](#97604) by [btbjosh](/forum/user/12727-btbjosh "View btbjosh's Profile")  *[Run a custom php script when order is complete](/forum/4-how-to/79986-run-a-custom-php-script-when-order-is-complete#97604 "I need to run a php script when the order is complete that can determine what was in the order. I.e. I need access to the $order object.  I need it to run for every order to check if a certain product was purchased.  Is this something that can be done without a plugin? Is there a view that I can access that I can implement my script into?  Thanks")* was created by *[btbjosh](/forum/user/12727-btbjosh "View btbjosh's Profile")*

I need to run a php script when the order is complete that can determine what was in the order. I.e. I need access to the $order object.

I need it to run for every order to check if a certain product was purchased.

Is this something that can be done without a plugin? Is there a view that I can access that I can implement my script into?

Thanks

---

![:)](/media/kunena/emoticons/8.png ":)") — Josh

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

13 years 6 months ago [\#97615](#97615) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Run a custom php script when order is complete](/forum/4-how-to/79986-run-a-custom-php-script-when-order-is-complete#97615 "I need to run a php script when the order is complete that can determine what was in the order. I.e. I need access to the $order object.  I need it to run for every order to check if a certain product was purchased.  Is this something that can be done without a plugin? Is there a view that I can access that I can implement my script into?  Thanks")*

Hi,

The best solution is to use a plugin.
[ www.hikashop.com/en/support/documentatio...#onAfterOrderConfirm](http://www.hikashop.com/en/support/documentation/62-hikashop-developer-documentation.html#onAfterOrderConfirm)

I don't see a right view which could contain such code because with some payment plugins it could not work at all.

Regards,

---

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

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

- **[btbjosh](/forum/user/12727-btbjosh "View btbjosh's Profile")**
- [![btbjosh's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/gallery/splatter_hand.png)](/forum/user/12727-btbjosh "View btbjosh's Profile") Topic Author
- [ Offline](/forum/user/12727-btbjosh)

Less More

- Posts: 90
- Thank you received: 1
-
-
-

13 years 6 months ago [\#97619](#97619) by [btbjosh](/forum/user/12727-btbjosh "View btbjosh's Profile")  Replied by *[btbjosh](/forum/user/12727-btbjosh "View btbjosh's Profile")* on topic *[Run a custom php script when order is complete](/forum/4-how-to/79986-run-a-custom-php-script-when-order-is-complete#97619 "I need to run a php script when the order is complete that can determine what was in the order. I.e. I need access to the $order object.  I need it to run for every order to check if a certain product was purchased.  Is this something that can be done without a plugin? Is there a view that I can access that I can implement my script into?  Thanks")*

Thanks for the response Jerome. I'm actually performing this function just fine inside the paypal plugin. This will work ok for us as long as we stick with it as the main payment option. For now it will be ok.

Something I noticed: (this could be an issue on paypal's sandbox mode) but it no longer offers the "Return URL" that it used to, even though my paypal configuration has not changed. Any ideas?

---

![:)](/media/kunena/emoticons/8.png ":)") — Josh

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzc5OTg2LXJ1bi1hLWN1c3RvbS1waHAtc2NyaXB0LXdoZW4tb3JkZXItaXMtY29tcGxldGU/dG1wbD1tYXJrZG93bg==) 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: 86293
- Thank you received: 14271
-
-

13 years 6 months ago [\#97707](#97707) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Run a custom php script when order is complete](/forum/4-how-to/79986-run-a-custom-php-script-when-order-is-complete#97707 "I need to run a php script when the order is complete that can determine what was in the order. I.e. I need access to the $order object.  I need it to run for every order to check if a certain product was purchased.  Is this something that can be done without a plugin? Is there a view that I can access that I can implement my script into?  Thanks")*

The return URL field is still present in the latest version of the PayPal payment plugin.

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

- **[btbjosh](/forum/user/12727-btbjosh "View btbjosh's Profile")**
- [![btbjosh's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/gallery/splatter_hand.png)](/forum/user/12727-btbjosh "View btbjosh's Profile") Topic Author
- [ Offline](/forum/user/12727-btbjosh)

Less More

- Posts: 90
- Thank you received: 1
-
-
-

13 years 6 months ago [\#97727](#97727) by [btbjosh](/forum/user/12727-btbjosh "View btbjosh's Profile")  Replied by *[btbjosh](/forum/user/12727-btbjosh "View btbjosh's Profile")* on topic *[Run a custom php script when order is complete](/forum/4-how-to/79986-run-a-custom-php-script-when-order-is-complete#97727 "I need to run a php script when the order is complete that can determine what was in the order. I.e. I need access to the $order object.  I need it to run for every order to check if a certain product was purchased.  Is this something that can be done without a plugin? Is there a view that I can access that I can implement my script into?  Thanks")*

Yeah, I saw the code in the PHP plugin file. I just am guessing it has something to do with paypal's revamping of their sandbox and developer portals. They've been acting all glitchy lately.

Just a heads up.

---

![:)](/media/kunena/emoticons/8.png ":)") — Josh

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

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

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

[](#top)
