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

Qty box visibility issue in wishlist when product is out of stock #22381

Conversation

ansari-ziyaurrahman
Copy link
Contributor

@ansari-ziyaurrahman ansari-ziyaurrahman commented Apr 17, 2019

Description (*)

Magento 2.3.x
Magento 2.2.x

Qty box should not be displayed in the wishlist if an added product is out of stock.

Fixed Issues (if relevant)

  1. magento/magento2#<issue_number>: Issue title
  2. ...

Manual testing scenarios (*)

  1. Set out of stock product display as a front end from admin configuration by below steps
    Stores >> Setting >> Configuration >> Catalog >> Inventory >> Display Out of Stock Products set Yes
  2. Login as a customer in frontend
  3. Add out of stock product into wishlist
  4. Review the product in My Wish List section in frontend where qty box is displayed for out of stock product.
    Screenshot from 2019 04 17 11 50 01

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds on Travis CI are green)

@m2-assistant
Copy link

m2-assistant bot commented Apr 17, 2019

Hi @ansari-krish. Thank you for your contribution
Here is some useful tips how you can test your changes using Magento test environment.
Add the comment under your pull request to deploy test or vanilla Magento instance:

  • @magento-engcom-team give me test instance - deploy test instance based on PR changes
  • @magento-engcom-team give me 2.3-develop instance - deploy vanilla Magento instance

For more details, please, review the Magento Contributor Assistant documentation

@magento-engcom-team
Copy link
Contributor

Hi @ihor-sviziev, thank you for the review.
ENGCOM-4770 has been created to process this Pull Request

@soleksii
Copy link

✔️ QA Passed

Before:

before

After:

after

Copy link
Contributor

@kalpmehta kalpmehta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason why Qty box should not be displayed if the product is not Saleable? There might be a case when customer want to see how many Qty of the product they added to wishlist, even though the product is out of stock.

@ansari-ziyaurrahman
Copy link
Contributor Author

Hi @kalpmehta,
Thanks for reviewing.
Yes, There might be a case so customer shows Qty box even though the product is out of stock.
But I have not found any condition related to this. When Product is out of stock than "Add to cart" button is not displayed so I have updated the code on based on that condition. When Product is out of stock then also Qty box is in Editable mode, We should remove it or disabled qty box when product is out of stock.
Please let me know your through. If you need to do any change here.
Thank you.

@kalpmehta
Copy link
Contributor

@magento-engcom-team give me test instance

@magento-engcom-team
Copy link
Contributor

Hi @kalpmehta. Thank you for your request. I'm working on Magento instance for you

@magento-engcom-team
Copy link
Contributor

Hi @kalpmehta, here is your new Magento instance.
Admin access: https://pr-22381.instances.magento-community.engineering/admin
Login: admin Password: 123123q

@kalpmehta
Copy link
Contributor

@ansari-krish Yes, can you please disable the Comment and Qty fields as it's anyway not editable when the product is not Saleable? Thanks

@ansari-ziyaurrahman
Copy link
Contributor Author

@ansari-krish Yes, can you please disable the Comment and Qty fields as it's anyway not editable when the product is not Saleable? Thanks

Hi @kalpmehta,
I have made changes as per your suggestions, Please review it.
Thanks

@kalpmehta
Copy link
Contributor

@magento-engcom-team give me test instance

@magento-engcom-team
Copy link
Contributor

Hi @kalpmehta. Thank you for your request. I'm working on Magento instance for you

@magento-engcom-team
Copy link
Contributor

Hi @kalpmehta, here is your new Magento instance.
Admin access: https://pr-22381.instances.magento-community.engineering/admin
Login: admin Password: 123123q

/** @var \Magento\Wishlist\ViewModel\AllowedQuantity $viewModel */
$viewModel = $block->getData('allowedQuantityViewModel');
$allowedQty = $viewModel->setItem($item)->getMinMaxQty();
$allowedQty = $block->getMinMaxQty();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ansari-krish Do you have to change this code for this PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please revert it then? thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

git issue is resolved, Please review now.

@ansari-ziyaurrahman ansari-ziyaurrahman force-pushed the patch-whishlist-qty-issue branch from 259eaa1 to be34f65 Compare April 18, 2019 06:30
@magento-engcom-team
Copy link
Contributor

Hi @kalpmehta, thank you for the review.
ENGCOM-4770 has been created to process this Pull Request

@soleksii
Copy link

✔️ QA Passed

Result:

after1

@m2-assistant
Copy link

m2-assistant bot commented Apr 20, 2019

Hi @ansari-krish, thank you for your contribution!
Please, complete Contribution Survey, it will take less than a minute.
Your feedback will help us to improve contribution process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants