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 zero price simple failed to resolve as default #16540

Conversation

torreytsui
Copy link
Contributor

@torreytsui torreytsui commented Jul 4, 2018

Description

When two simple products of a configurable have different prices, the lowest price simple product is expected to resolve as the default price showing on product detail page.

If one of the simple products has price=0, it will fail to resolve as default.

Notice that it is an edge case having price=0 product. It probably is still worth fixing.

Fixed Issues (if relevant)

Can't find any related issues at the moment

Manual testing scenarios

  1. Set up a configurable with two simple products. One simple have price at £3, another at £0
  2. The simple products with LOWER product id must be at £0
  3. Go to product detail page of the configurable

Expected result: Default price rendered as £0
Actual result: Default price rendered as £3

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)

@magento-cicd2
Copy link
Contributor

magento-cicd2 commented Jul 4, 2018

CLA assistant check
All committers have signed the CLA.

@magento-engcom-team magento-engcom-team added Partner: Ampersand partners-contribution Pull Request is created by Magento Partner labels Jul 4, 2018
@magento-engcom-team
Copy link
Contributor

Hi @torreytsui. 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 {$VERSION} instance - deploy vanilla Magento instance

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

@torreytsui
Copy link
Contributor Author

@magento-engcom-team give me 2.2-develop instance

@magento-engcom-team
Copy link
Contributor

Hi @torreytsui. Thank you for your request. I'm working on Magento 2.2-develop instance for you

@magento-engcom-team
Copy link
Contributor

Hi @torreytsui, here is your Magento instance.
Admin access: https://i-16540-2-2-develop.engcom.dev.magento.com/admin
Login: admin Password: 123123q
Instance will be terminated in up to 3 hours.

@torreytsui
Copy link
Contributor Author

Tested on the instance and somehow can't replicate. I have done a 3v4l demo, hopefully this can convince as a bug.

https://3v4l.org/Jk6lT

@VladimirZaets
Copy link
Contributor

Hi @torreytsui, thank you for the collaboration. The issue doesn't reproduce, but I agree that your fix is correct.
This is an important functionality, please cover your changes with tests.
Thanks

0,
20,
],
$expectedPrice = 0.00,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi @VladimirZaets I have refactored the unit test to be more meaningful as test cases. New test cases are added to reflect the bug. Does it make sense to you?

Copy link
Contributor

Choose a reason for hiding this comment

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

Hi @torreytsui, yes, it is ok, thanks!

@magento-engcom-team
Copy link
Contributor

Hi @torreytsui. Thank you for your contribution.
We will aim to release these changes as part of 2.2.6.
Please check the release notes for final confirmation.

Please, consider to port this solution to 2.3 release line.
You may use Porting tool to port commits automatically.

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.

4 participants