-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Fix undefined property #11764
Fix undefined property #11764
Conversation
classes/Cart.php
Outdated
@@ -1324,6 +1324,8 @@ public function updateQty( | |||
// The $id_address_delivery must be linked with customer | |||
$id_address_delivery = 0; | |||
} | |||
} else { | |||
$id_address_delivery = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is it necessary to reset the $id_address_delivery value? I thought you wanted to cover a case when the variable does not exist, but it exist from the method signature.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just wanted to catch the warning when Context::getContext()->customer
doesn't exist! $id_address_delivery = 0
is default value when customer doesn't has address.
My problem comes when I remove a cart rule with a free gift from the backoffice and I update cart.
Sending this PR to QA review. In the meantime @idnovate, please take some time to run |
Hello @idnovate Can you send me the module ? It will alowed to reproduce the issue and check your PR Thanks :) |
I did a modification to the code and executed |
I attach you a very simple module -> dummymodule.zip. How to reproduce the issue:
|
Thanks @idnovate |
This change is