New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hook actionCartSave
does not receive proper cart data when being triggered from Webservice.
#20509
Comments
Thanks for opening this issue! We will help you to keep its state consistent |
Hi @elboletaire, I did not manage to reproduce the issue with PS1.7.6.7. Thanks to check and feedback. |
Can you please explain me the exact steps you followed? I have reproduced this both in prestashop 1.7.6 and prestashop 1.7.7 (clean installs using docker), and both times got the same result. Are you using a fresh install? Or maybe you have some setting that could affect this behavior? |
@elboletaire, I have this Thanks! |
@elboletaire, thanks for your feedback. |
Describe the bug
The
actionCartSave
hook triggered on Cart save & update is not properly being initialized when being triggered as a result of a cart update using the Webservice.The problem seems to be related with the context being initialized later, but only when using the Webservice. By default,
Hook::exec
sets the cart if it's not previously set, getting it from the context. Neither inadd
nor inupdate
the hook is being called with arguments, making it falling back to taking the cart from the context.Manually adding the
cart
to the update/add method solves this issue:I know this is NOT the way to fix it, I'm just trying to show my point, that the cart is not properly set in context in this specific case.
Expected behavior
To receive the proper cart information, as when being called without the webservice
Steps to Reproduce
Steps to reproduce the behavior:
actionCartSave
with adump($params)
on it, just for debugging.Click here to see the full xml sent to the cart endpoint
Additional information
The text was updated successfully, but these errors were encountered: