Jump to content

[SOLVED] product quantity update after successful order confirmation


SRUTHI R BABU

Recommended Posts

Can anyone explain how does the product quantity change when an order is successful ? I have this particular requirement of changing quantity of all combinations when an order is placed for a single combination of a product. The functionality is set and working perfectly for all cases except when using paypal from ps_checkout module. So if anyone can help out on how to implement my functionality in this case, would be helpful.

I couldn't exactly pinpoint where exactly the product quantity is getting updated in the paypal scenario.

Edited by SRUTHI R BABU (see edit history)
Link to comment
Share on other sites

here's a screenshot of what I have done to give you more idea about the task. as you can see here there are three combination of the product but it's considered as the same product ie. if someone purchases the pack of 10 here then the quantity will update for all the three combinations here and change to 2592. Hope this clarifies the issue I am trying sort outScreenshot2024-01-31131832.png.28a603c4ec3154fc94e77b1adc3e3169.png

Link to comment
Share on other sites

On 2/1/2024 at 2:16 PM, Prestashop Addict said:

You mean, when an order use Paypal payment method in ps_checkout the stock is not decremented?

Yeah something like that @Prestashop Addict. I have fixed the issue. The problem was I had written a custom code for the said functionality in hookActionValidateOrder on another module ( used for the mentioned quantity customisation ) and this hook was not executing properly when using Paypal via ps_checkout module. On further analysis it seemed like there is some sort of server issue ( discussion with team suggested this ) because when I tried to debug the same from PaymentModule class the action seemed to be working perfectly working. So I did the obvious instead of the hookActionValidateOrder I changed the function name in module and called it in paymentmodule class override and it now works perfectly. Thanks for all the responses. Hope this helps someone too :)

Edited by SRUTHI R BABU (see edit history)
Link to comment
Share on other sites

  • SRUTHI R BABU changed the title to [SOLVED] product quantity update after successful order confirmation

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...