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

Old price excluding TAX shown correct on Product Page #27832

Merged
merged 9 commits into from
Sep 10, 2020
Merged

Old price excluding TAX shown correct on Product Page #27832

merged 9 commits into from
Sep 10, 2020

Conversation

Krielkip
Copy link
Contributor

@Krielkip Krielkip commented Apr 12, 2020

With this fix, the price excluding tax of the old price on an product on sale, is not being overwritten with JS. Also checked this for configurable products

Description (*)

I added the the option to add the baseOldPrice, so that in the javascript of the configurable product, all the default actions are the same. No price calculations has been changed.

Fixed Issues (if relevant)

  1. Old price excluding TAX is incorrectly replaced by JavaScript #11998: Old price excluding TAX is incorrectly replaced by JavaScript

Manual testing scenarios (*)

[ This needs a template File Edit! ]

  1. In Admin, set Stores -> Configuration -> SALES -> Tax -> Price Display Settings -> Display Product Prices In Catalog to "Including and Excluding Tax"
  2. Configure tax class and set it for the product
  3. Set special price for the product
    4a. In vendor/magento/module-catalog/view/base/templates/product/price/final_price.phtml, set "skip_adjustments" to FALSE for "old-price"
    4b. In vendor/magento/module-configurable-roduct/view/base/templates/product/price/final_price.phtml, set "skip_adjustments" to FALSE for "old-price"
  4. Go to a product that has a new special price.

Questions or comments

Please check if all type of products are correct.
I have did some checking, but i can understand that i missed a setup 😸

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 are green)

Has connection with

@m2-assistant
Copy link

m2-assistant bot commented Apr 12, 2020

Hi @Krielkip. 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 give me test instance - deploy test instance based on PR changes
  • @magento give me 2.4-develop instance - deploy vanilla Magento instance

For more details, please, review the Magento Contributor Guide documentation.

@Krielkip Krielkip requested a review from Jason-Sy April 16, 2020 09:38
@sidolov sidolov added Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Severity: S2 Major restrictions or short-term circumventions are required until a fix is available. labels Aug 17, 2020
@gabrieldagama gabrieldagama self-assigned this Aug 26, 2020
Copy link
Contributor

@gabrieldagama gabrieldagama left a comment

Choose a reason for hiding this comment

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

Hi @Krielkip, thanks for the PR, it looks great! Kudos for updating the Unit Tests, really good work!

Please follow a small comment on the code, also, would you be able to update this PR with 2.4-develop? Thanks!

Comment on lines 186 to 189
if ($this->getData('price_type') && $this->getData('price_type') !== 'finalPrice') {
return 'base' . ucfirst($this->getData('price_type'));
}
return 'basePrice';
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
if ($this->getData('price_type') && $this->getData('price_type') !== 'finalPrice') {
return 'base' . ucfirst($this->getData('price_type'));
}
return 'basePrice';
if ($this->amountRender->getPriceType() === 'finalPrice') {
return 'basePrice';
}
return 'base' . ucfirst($this->amountRender->getPriceType());

I guess it may be easier to understand the === instead of !==. Also, it may be better to use the $this->amountRender->getPriceType() instead of the getData. What do you think?

@engcom-Charlie
Copy link
Contributor

Hi @Krielkip can you please look at #27832 (review)?
Otherwise, we can't proceed with your PR.
Thank you.

# Conflicts:
#	app/code/Magento/ConfigurableProduct/Test/Unit/Block/Product/View/Type/ConfigurableTest.php
#	app/code/Magento/ConfigurableProduct/Test/Unit/Model/Product/Type/Configurable/Variations/PricesTest.php
@engcom-Charlie
Copy link
Contributor

@magento run all tests

@magento-engcom-team
Copy link
Contributor

Hi @gabrieldagama, thank you for the review.
ENGCOM-8158 has been created to process this Pull Request
✳️ @gabrieldagama, could you please add one of the following labels to the Pull Request?

Label Description
Auto-Tests: Covered All changes in Pull Request is covered by auto-tests
Auto-Tests: Not Covered Changes in Pull Request requires coverage by auto-tests
Auto-Tests: Not Required Changes in Pull Request does not require coverage by auto-tests

@gabrieldagama gabrieldagama added the Auto-Tests: Covered All changes in Pull Request is covered by auto-tests label Sep 8, 2020
@engcom-Alfa engcom-Alfa self-assigned this Sep 10, 2020
@engcom-Alfa
Copy link
Contributor

✔️ QA Passed

Manual testing scenario:

  1. In Admin, set Stores -> Configuration -> SALES -> Tax -> Price Display Settings -> Display Product Prices In Catalog to "Including and Excluding Tax"
  2. Configure tax class and set it for the product
  3. Set special price for the product
    4a. In app/code/Magento/Catalog/view/base/templates/product/price/final_price.phtml, set "skip_adjustments" to FALSE for "old-price"
    4b. In app/code/Magento/ConfigurableProduct/view/base/templates/product/price/final_price.phtml, set "skip_adjustments" to FALSE for "old-price"
  4. Go to a product that has a new special price.

Before: ✖️ New price and old price excluding TAX are the same

✖️ Simple Product

2020-09-10_10-14

✖️ Configurable Product

2020-09-10_10-15

✖️ Bundle Product

2020-09-10_10-18

After: ✔️ On product detail view page in frontend, old price and new price are displayed with and without TAX

✔️ Simple Product

2020-09-10_10-34

✔️ Configurable Product

2020-09-10_10-35

✔️ Bundle Product

2020-09-10_10-36

✔️ Grouped Product

2020-09-10_10-41

@m2-assistant
Copy link

m2-assistant bot commented Sep 10, 2020

Hi @Krielkip, 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.

@Krielkip Krielkip deleted the bugfix/11998 branch November 11, 2020 16:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Frontend Auto-Tests: Covered All changes in Pull Request is covered by auto-tests Component: Catalog Component: ConfigurableProduct Component: Tax Partner: Bluebird Day partners-contribution Pull Request is created by Magento Partner Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Progress: accept QA: Added to Regression Scope Scenario was analysed and added to Regression Testing Scope Release Line: 2.4 Severity: S2 Major restrictions or short-term circumventions are required until a fix is available.
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

6 participants