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

#   Change stock deduction to on completion

##

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

Less More

- Posts: 8
- Thank you received: 0
-
-

14 years 3 months ago [\#60068](#60068) by [daniel](/forum/user/5754-daniel "View daniel's Profile")  *[Change stock deduction to on completion](/forum/4-how-to/60068-change-stock-deduction-to-on-completion#60068 "Hi,  I need to change the way stock is deducted when an order goes through, at the moment stock is deducted on order creation but I need to deduct stock on order completion. I have created a plugin and used the trigger onBeforeOrderUpdate and onAfterOrderUpdate. I have successfully changed the stock deduction to happen when the order is completed, but I am having trouble getting it to work correctly with order modifications (Add an existing product). The order is modified before I can catch it in the onBeforeOrderUpdate trigger.  Your help would be appreciated.  Kind Regards Dan")* was created by *[daniel](/forum/user/5754-daniel "View daniel's Profile")*

Hi,

I need to change the way stock is deducted when an order goes through, at the moment stock is deducted on order creation but I need to deduct stock on order completion. I have created a plugin and used the trigger onBeforeOrderUpdate and onAfterOrderUpdate. I have successfully changed the stock deduction to happen when the order is completed, but I am having trouble getting it to work correctly with order modifications (Add an existing product). The order is modified before I can catch it in the onBeforeOrderUpdate trigger.

Your help would be appreciated.

Kind Regards
Dan

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzYwMDY4LWNoYW5nZS1zdG9jay1kZWR1Y3Rpb24tdG8tb24tY29tcGxldGlvbj90bXBsPW1hcmtkb3du) 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")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86583
- Thank you received: 14323
-
-

14 years 3 months ago [\#60130](#60130) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Change stock deduction to on completion](/forum/4-how-to/60068-change-stock-deduction-to-on-completion#60130 "Hi,  I need to change the way stock is deducted when an order goes through, at the moment stock is deducted on order creation but I need to deduct stock on order completion. I have created a plugin and used the trigger onBeforeOrderUpdate and onAfterOrderUpdate. I have successfully changed the stock deduction to happen when the order is completed, but I am having trouble getting it to work correctly with order modifications (Add an existing product). The order is modified before I can catch it in the onBeforeOrderUpdate trigger.  Your help would be appreciated.  Kind Regards Dan")*

Hi,

Orders are never modified before the onBeforeOrderUpdate trigger. So that's not possible.
However, the product is added to the order before the order information is updated. Is that what you're talking about ?

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

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

Less More

- Posts: 8
- Thank you received: 0
-
-

14 years 3 months ago [\#60146](#60146) by [daniel](/forum/user/5754-daniel "View daniel's Profile")  Replied by *[daniel](/forum/user/5754-daniel "View daniel's Profile")* on topic *[Re: Change stock deduction to on completion](/forum/4-how-to/60068-change-stock-deduction-to-on-completion#60146 "Hi,  I need to change the way stock is deducted when an order goes through, at the moment stock is deducted on order creation but I need to deduct stock on order completion. I have created a plugin and used the trigger onBeforeOrderUpdate and onAfterOrderUpdate. I have successfully changed the stock deduction to happen when the order is completed, but I am having trouble getting it to work correctly with order modifications (Add an existing product). The order is modified before I can catch it in the onBeforeOrderUpdate trigger.  Your help would be appreciated.  Kind Regards Dan")*

Hi,

Yes, what I wanted to do was use onBeforeOrderUpdate to catch the product before it was added to the order then in the onAfterOrderUpdate deduct the stock from the added product using a database call. Is there any way this can be done?

Kind Regards
Dan

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzYwMDY4LWNoYW5nZS1zdG9jay1kZWR1Y3Rpb24tdG8tb24tY29tcGxldGlvbj90bXBsPW1hcmtkb3du) 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")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86583
- Thank you received: 14323
-
-

14 years 3 months ago [\#60227](#60227) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Change stock deduction to on completion](/forum/4-how-to/60068-change-stock-deduction-to-on-completion#60227 "Hi,  I need to change the way stock is deducted when an order goes through, at the moment stock is deducted on order creation but I need to deduct stock on order completion. I have created a plugin and used the trigger onBeforeOrderUpdate and onAfterOrderUpdate. I have successfully changed the stock deduction to happen when the order is completed, but I am having trouble getting it to work correctly with order modifications (Add an existing product). The order is modified before I can catch it in the onBeforeOrderUpdate trigger.  Your help would be appreciated.  Kind Regards Dan")*

Why not simply do everything in the onAfterOrderUpdate event ? You still have the product in the $object after it has been added in the db.

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

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

Less More

- Posts: 66
- Thank you received: 0
-
-

14 years 3 months ago [\#60438](#60438) by [luizarios](/forum/user/3405-luizarios "View luizarios's Profile")  Replied by *[luizarios](/forum/user/3405-luizarios "View luizarios's Profile")* on topic *[Re: Change stock deduction to on completion](/forum/4-how-to/60068-change-stock-deduction-to-on-completion#60438 "Hi,  I need to change the way stock is deducted when an order goes through, at the moment stock is deducted on order creation but I need to deduct stock on order completion. I have created a plugin and used the trigger onBeforeOrderUpdate and onAfterOrderUpdate. I have successfully changed the stock deduction to happen when the order is completed, but I am having trouble getting it to work correctly with order modifications (Add an existing product). The order is modified before I can catch it in the onBeforeOrderUpdate trigger.  Your help would be appreciated.  Kind Regards Dan")*

Hi, I am after the same thing, I want to be able to only reduce my stock when the order has been paid for, I have a read on the posts above but can't understand what was done, is there any chance of some clarification please?

Daniel, would you be able to share the plugin?

Many thanks

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzYwMDY4LWNoYW5nZS1zdG9jay1kZWR1Y3Rpb24tdG8tb24tY29tcGxldGlvbj90bXBsPW1hcmtkb3du) 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")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86583
- Thank you received: 14323
-
-

14 years 3 months ago [\#60492](#60492) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Change stock deduction to on completion](/forum/4-how-to/60068-change-stock-deduction-to-on-completion#60492 "Hi,  I need to change the way stock is deducted when an order goes through, at the moment stock is deducted on order creation but I need to deduct stock on order completion. I have created a plugin and used the trigger onBeforeOrderUpdate and onAfterOrderUpdate. I have successfully changed the stock deduction to happen when the order is completed, but I am having trouble getting it to work correctly with order modifications (Add an existing product). The order is modified before I can catch it in the onBeforeOrderUpdate trigger.  Your help would be appreciated.  Kind Regards Dan")*

Hi,

You would have to update back the quantity of the products in the onAfterOrderCreate event so that the stock is left unchanged using a MySQL query on the hikashop_product table.
And then you would have to update the stock in the onAfterOrderUpdate event after loading the order data with the loadFullOrder function of the class.order file of HikaShop. That will also require using a MySQL query on the hikashop_product table.
These would have to be implemented in a hikashop plugin.

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

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

Less More

- Posts: 173
- Thank you received: 8
-
-

14 years 1 week ago [\#77160](#77160) by [ianspeed](/forum/user/1602-ianspeed "View ianspeed's Profile")  Replied by *[ianspeed](/forum/user/1602-ianspeed "View ianspeed's Profile")* on topic *[Change stock deduction to on completion](/forum/4-how-to/60068-change-stock-deduction-to-on-completion#77160 "Hi,  I need to change the way stock is deducted when an order goes through, at the moment stock is deducted on order creation but I need to deduct stock on order completion. I have created a plugin and used the trigger onBeforeOrderUpdate and onAfterOrderUpdate. I have successfully changed the stock deduction to happen when the order is completed, but I am having trouble getting it to work correctly with order modifications (Add an existing product). The order is modified before I can catch it in the onBeforeOrderUpdate trigger.  Your help would be appreciated.  Kind Regards Dan")*

Hi Nicolas,
Hope you are well.
Just had to ask,is there going to be a "order confirmed" stock deduction option as apposed to a "order created" stock deduction, as my customer had two one off items go out of stock when the customer failed to pay at paypal... ![:-(](/media/kunena/emoticons/22.png ":-(")

Thanks

Ian

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzYwMDY4LWNoYW5nZS1zdG9jay1kZWR1Y3Rpb24tdG8tb24tY29tcGxldGlvbj90bXBsPW1hcmtkb3du) 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: 26401
- Thank you received: 4081
-
- [](http://obsi.dev)
-

14 years 6 days ago [\#77269](#77269) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Change stock deduction to on completion](/forum/4-how-to/60068-change-stock-deduction-to-on-completion#77269 "Hi,  I need to change the way stock is deducted when an order goes through, at the moment stock is deducted on order creation but I need to deduct stock on order completion. I have created a plugin and used the trigger onBeforeOrderUpdate and onAfterOrderUpdate. I have successfully changed the stock deduction to happen when the order is completed, but I am having trouble getting it to work correctly with order modifications (Add an existing product). The order is modified before I can catch it in the onBeforeOrderUpdate trigger.  Your help would be appreciated.  Kind Regards Dan")*

Hi Ian,

We have put your request in our TODO list for the next HikaShop release.

Best regards,

---

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

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

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

- **[melisari](/forum/user/9503-melisari "View melisari's Profile")**
- [![melisari's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/gallery/origami.png)](/forum/user/9503-melisari "View melisari's Profile")
- [ Offline](/forum/user/9503-melisari)

Less More

- Posts: 103
- Thank you received: 2
-
-

13 years 6 months ago [\#105035](#105035) by [melisari](/forum/user/9503-melisari "View melisari's Profile")  Replied by *[melisari](/forum/user/9503-melisari "View melisari's Profile")* on topic *[Change stock deduction to on completion](/forum/4-how-to/60068-change-stock-deduction-to-on-completion#105035 "Hi,  I need to change the way stock is deducted when an order goes through, at the moment stock is deducted on order creation but I need to deduct stock on order completion. I have created a plugin and used the trigger onBeforeOrderUpdate and onAfterOrderUpdate. I have successfully changed the stock deduction to happen when the order is completed, but I am having trouble getting it to work correctly with order modifications (Add an existing product). The order is modified before I can catch it in the onBeforeOrderUpdate trigger.  Your help would be appreciated.  Kind Regards Dan")*

Ian said:

"Hi Nicolas,
Hope you are well.
Just had to ask,is there going to be a "order confirmed" stock deduction option as apposed to a "order created" stock deduction, as my customer had two one off items go out of stock when the customer failed to pay at paypal...

Thanks

Ian"

This is what is happening to me. Is still in the "to do´s" list, or is something that its suppouse to be working now? A lot of people go to paypal and doesnt pay.

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

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

Less More

- Posts: 173
- Thank you received: 8
-
-

13 years 6 months ago [\#105037](#105037) by [ianspeed](/forum/user/1602-ianspeed "View ianspeed's Profile")  Replied by *[ianspeed](/forum/user/1602-ianspeed "View ianspeed's Profile")* on topic *[Change stock deduction to on completion](/forum/4-how-to/60068-change-stock-deduction-to-on-completion#105037 "Hi,  I need to change the way stock is deducted when an order goes through, at the moment stock is deducted on order creation but I need to deduct stock on order completion. I have created a plugin and used the trigger onBeforeOrderUpdate and onAfterOrderUpdate. I have successfully changed the stock deduction to happen when the order is completed, but I am having trouble getting it to work correctly with order modifications (Add an existing product). The order is modified before I can catch it in the onBeforeOrderUpdate trigger.  Your help would be appreciated.  Kind Regards Dan")*

Hi Melisari,
This is actually implemented now. If you look under the configuration and main, then look at Product options you'll see the "Update the product stock on confirmed status" Radio box...

Hope this helps.

Ian

- [ ![2013-05-18&#95;204214.jpg](/forum/attachment/10224) ](/forum/attachment/10224 "...-18&#95;204214.jpg") [ ](/forum/attachment/10224?download=1 "...-18&#95;204214.jpg")

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

- **[melisari](/forum/user/9503-melisari "View melisari's Profile")**
- [![melisari's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/gallery/origami.png)](/forum/user/9503-melisari "View melisari's Profile")
- [ Offline](/forum/user/9503-melisari)

Less More

- Posts: 103
- Thank you received: 2
-
-

13 years 6 months ago [\#105038](#105038) by [melisari](/forum/user/9503-melisari "View melisari's Profile")  Replied by *[melisari](/forum/user/9503-melisari "View melisari's Profile")* on topic *[Change stock deduction to on completion](/forum/4-how-to/60068-change-stock-deduction-to-on-completion#105038 "Hi,  I need to change the way stock is deducted when an order goes through, at the moment stock is deducted on order creation but I need to deduct stock on order completion. I have created a plugin and used the trigger onBeforeOrderUpdate and onAfterOrderUpdate. I have successfully changed the stock deduction to happen when the order is completed, but I am having trouble getting it to work correctly with order modifications (Add an existing product). The order is modified before I can catch it in the onBeforeOrderUpdate trigger.  Your help would be appreciated.  Kind Regards Dan")*

But is not working for me ![:(](/media/kunena/emoticons/22.png ":(") I dont know why.

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

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

Less More

- Posts: 173
- Thank you received: 8
-
-

13 years 6 months ago [\#105040](#105040) by [ianspeed](/forum/user/1602-ianspeed "View ianspeed's Profile")  Replied by *[ianspeed](/forum/user/1602-ianspeed "View ianspeed's Profile")* on topic *[Change stock deduction to on completion](/forum/4-how-to/60068-change-stock-deduction-to-on-completion#105040 "Hi,  I need to change the way stock is deducted when an order goes through, at the moment stock is deducted on order creation but I need to deduct stock on order completion. I have created a plugin and used the trigger onBeforeOrderUpdate and onAfterOrderUpdate. I have successfully changed the stock deduction to happen when the order is completed, but I am having trouble getting it to work correctly with order modifications (Add an existing product). The order is modified before I can catch it in the onBeforeOrderUpdate trigger.  Your help would be appreciated.  Kind Regards Dan")*

Is PayPal actually sending a response back? Would you normally get a confirmation of order payed, or does just stay at created when the order is created and payed for?

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

- **[melisari](/forum/user/9503-melisari "View melisari's Profile")**
- [![melisari's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/gallery/origami.png)](/forum/user/9503-melisari "View melisari's Profile")
- [ Offline](/forum/user/9503-melisari)

Less More

- Posts: 103
- Thank you received: 2
-
-

13 years 6 months ago [\#105041](#105041) by [melisari](/forum/user/9503-melisari "View melisari's Profile")  Replied by *[melisari](/forum/user/9503-melisari "View melisari's Profile")* on topic *[Change stock deduction to on completion](/forum/4-how-to/60068-change-stock-deduction-to-on-completion#105041 "Hi,  I need to change the way stock is deducted when an order goes through, at the moment stock is deducted on order creation but I need to deduct stock on order completion. I have created a plugin and used the trigger onBeforeOrderUpdate and onAfterOrderUpdate. I have successfully changed the stock deduction to happen when the order is completed, but I am having trouble getting it to work correctly with order modifications (Add an existing product). The order is modified before I can catch it in the onBeforeOrderUpdate trigger.  Your help would be appreciated.  Kind Regards Dan")*

At first, the problem appeared only when a client closed the paypal window, i asked for help, and nicolas recommend this:

There are two solutions in HikaShop to help you here:
1. You use the "order auto cancel" plugin (you need to setup the cron task of the configuration for that) in order to cancel automatically orders after X hours without payment.
2. You remove the stock only when the order is confirmed, and not when the order is created. You can toggle the option "Update the product stock on confirmed status" of the configuration for that.

I already had the 2 option implemented and still had the problem, so, i did number 1. And now, the stock is removed always when the client goes to paypal, even when the client click on "cancel and return".

Thank you so much for your help, my client have some unique products that can be sold only 4 times and some of them, just once, so, i need to solve this.

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

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

Less More

- Posts: 13201
- Thank you received: 2322
-
-
-
- [](http://www.kidiweb.fr)
-

13 years 6 months ago [\#105210](#105210) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[Change stock deduction to on completion](/forum/4-how-to/60068-change-stock-deduction-to-on-completion#105210 "Hi,  I need to change the way stock is deducted when an order goes through, at the moment stock is deducted on order creation but I need to deduct stock on order completion. I have created a plugin and used the trigger onBeforeOrderUpdate and onAfterOrderUpdate. I have successfully changed the stock deduction to happen when the order is completed, but I am having trouble getting it to work correctly with order modifications (Add an existing product). The order is modified before I can catch it in the onBeforeOrderUpdate trigger.  Your help would be appreciated.  Kind Regards Dan")*

Hi,

And you have the latest version of HikaShop ? v2.1.3 ?
Can yuou give us a backend access and a ftp access too in order to debug ?

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

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

- **[melisari](/forum/user/9503-melisari "View melisari's Profile")**
- [![melisari's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/gallery/origami.png)](/forum/user/9503-melisari "View melisari's Profile")
- [ Offline](/forum/user/9503-melisari)

Less More

- Posts: 103
- Thank you received: 2
-
-

13 years 6 months ago [\#105480](#105480) by [melisari](/forum/user/9503-melisari "View melisari's Profile")  Replied by *[melisari](/forum/user/9503-melisari "View melisari's Profile")* on topic *[Change stock deduction to on completion](/forum/4-how-to/60068-change-stock-deduction-to-on-completion#105480 "Hi,  I need to change the way stock is deducted when an order goes through, at the moment stock is deducted on order creation but I need to deduct stock on order completion. I have created a plugin and used the trigger onBeforeOrderUpdate and onAfterOrderUpdate. I have successfully changed the stock deduction to happen when the order is completed, but I am having trouble getting it to work correctly with order modifications (Add an existing product). The order is modified before I can catch it in the onBeforeOrderUpdate trigger.  Your help would be appreciated.  Kind Regards Dan")*

Thank you Xavier! Jerome already helped me with this. He enter my site and fixed everything. You guys have the best support in the joomla word, thank you so much for your efforts and keep going!

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

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