Skip to content

Add price calculation improvement for product option value price #11563

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

Merged
merged 2 commits into from
Dec 14, 2017

Conversation

marinagociu
Copy link

Description

The price calculation for the product option value relied on the getFinalPrice value, which if called without the qty parameter will not consider tier prices.
This method was updated to use the base price as calculated by the priceInfo object, just like in Magento\Catalog\Model\Product\Option.

Fixed Issues (if relevant)

  1. Tier price and custom options give bad results #5774: Tier price and custom options give bad results

Manual testing scenarios

  1. Create a product with a regular price.
  2. Add a tier price with quantity 1, a customer group and a smaller price than the regular one.
  3. Add a custom option using a type that will allow adding values (for example, Checkbox).
  4. Add a value with Price Type: Percent, and a price value (for example, 100).
  5. Login with a customer from the customer group used when adding the tier price.
  6. Go to the product page, the product price should be the tier price added for the customer group and the price of the custom option value should be calculated based on the corresponding product tier price, and not the product regular price.

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)

The price calculation relied on the getFinalPrice value, which if
called without the qty parameter will not consider tier prices.
This method was not updated when the price improvements have been
added around 4 years ago. See similar update that was added for
Magento\Catalog\Model\Product\Option.

Resolves: magento#5774
@avoelkl avoelkl self-assigned this Nov 2, 2017
@magento-engcom-team magento-engcom-team added 2.2.x bugfix Reproduced on 2.1.x The issue has been reproduced on latest 2.1 release Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release labels Nov 7, 2017
@dmanners dmanners self-assigned this Dec 14, 2017
@dmanners dmanners added this to the December 2017 milestone Dec 14, 2017
@dmanners
Copy link
Contributor

Thank you for this PR @marinagociu I will get this processed through our QA team for you now.

@okorshenko okorshenko removed the 2.2.x label Dec 14, 2017
@magento-team magento-team merged commit 7ff22bf into magento:2.2-develop Dec 14, 2017
@magento-engcom-team magento-engcom-team added the Fixed in 2.2.x The issue has been fixed in 2.2 release line label Dec 14, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix Fixed in 2.2.x The issue has been fixed in 2.2 release line Progress: accept Release Line: 2.2 Reproduced on 2.1.x The issue has been reproduced on latest 2.1 release Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants