Skip to content
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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

aneteupeniece
Copy link

@aneteupeniece aneteupeniece commented May 25, 2021

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

…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;
Copy link
Contributor

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;
Copy link
Contributor

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");
Copy link
Contributor

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.

Comment on lines 130 to 131
$buyRequest = new DataObject();
$buyRequest->setData($data);
Copy link
Contributor

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?

Copy link
Author

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
@aneteupeniece aneteupeniece requested a review from yeegor June 1, 2021 11:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants