-
Notifications
You must be signed in to change notification settings - Fork 12
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 for #2533 Products which in stock aren't added to cart from Wishlist if user has products out of stock in Wishlist #19
base: master
Are you sure you want to change the base?
Conversation
…ed to cart from Wishlist if user has products out of stock in Wishlist
foreach ($wishlistItems as $item) { | ||
$product = $item['product']; | ||
$cartItems = $quote->getItems(); | ||
$addedQty = false; |
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.
Naming addedQty
implies having a quantity stored in that variable. Despite this, a boolean value is stored.
|
||
$data = json_decode($item['buy_request'], true); | ||
$allItemsStatus = false; |
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.
This naming is not verbose - it is impossible to understand what this is a flag for. Please rename.
try { | ||
if ($shouldShowError){ | ||
throw new GraphQlInputException("error"); |
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.
Please provide an actual error message here.
$buyRequest = new DataObject(); | ||
$buyRequest->setData($data); |
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.
What is this for? Maybe it's possible to get rid of this? Seems like you pass an empty array there, why is it necessary?
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.
This seems to have been here before my changes.
…ed to cart from Wishlist if user has products out of stock in Wishlist
Task: scandipwa/scandipwa#2533
Problem was that in stock items are not adding to cart from wishlist when there are out of stock items in it and not showing notifications correctly. This is the BE part of the fix. The FE part: scandipwa/scandipwa#2668