Skip to content

MC-38025: FPT disappears when switching back to the cart page #31563

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 1 commit into from
Jan 13, 2021

Conversation

engcom-Golf
Copy link
Contributor

Description (*)

Used quote items in weee tax total calculation instead of quote address items

Related Pull Requests

Fixed Issues (if relevant)

  1. Fixes FPT disappears when switching back to the cart page  #30250

Manual testing scenarios (*)

See #30250
Expected result:
FPT tax value shouldn't disappear from totals block

Questions or comments

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)

@m2-assistant
Copy link

m2-assistant bot commented Jan 6, 2021

Hi @engcom-Golf. 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

❗ Automated tests can be triggered manually with an appropriate comment:

  • @magento run all tests - run or re-run all required tests against the PR changes
  • @magento run <test-build(s)> - run or re-run specific test build(s)
    For example: @magento run Unit Tests

<test-build(s)> is a comma-separated list of build names. Allowed build names are:

  1. Database Compare
  2. Functional Tests CE
  3. Functional Tests EE,
  4. Functional Tests B2B
  5. Integration Tests
  6. Magento Health Index
  7. Sample Data Tests CE
  8. Sample Data Tests EE
  9. Sample Data Tests B2B
  10. Static Tests
  11. Unit Tests
  12. WebAPI Tests

You can find more information about the builds here

ℹ️ Please run only needed test builds instead of all when developing. Please run all test builds before sending your PR for review.

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

⚠️ According to the Magento Contribution requirements, all Pull Requests must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.

🕙 You can find the schedule on the Magento Community Calendar page.

📞 The triage of Pull Requests happens in the queue order. If you want to speed up the delivery of your contribution, please join the Community Contributions Triage session to discuss the appropriate ticket.

🎥 You can find the recording of the previous Community Contributions Triage on the Magento Youtube Channel

✏️ Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel

@m2-community-project m2-community-project bot added Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Severity: S3 Affects non-critical data or functionality and does not force users to employ a workaround. labels Jan 6, 2021
@engcom-Golf
Copy link
Contributor Author

@magento run all tests

@engcom-Golf
Copy link
Contributor Author

@magento run all tests

{
/** @var $items \Magento\Sales\Model\Order\Item[] */
$items = isset($total['address_quote_items']) ? $total['address_quote_items'] : [];
$items = isset($total['quote_items']) ? $total['quote_items'] : [];
Copy link
Contributor

Choose a reason for hiding this comment

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

Please simplify this to $items = $total['quote_items'] ?? [];

$quote = $quoteFactory->create();
$quoteResource->load($quote, 'multishipping_fpt_quote_id', 'reserved_order_id');
$cartId = $quote->getId();
$addressFactory = $this->objectManager->get(\Magento\Quote\Model\Quote\AddressFactory::class);
Copy link
Contributor

Choose a reason for hiding this comment

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

Please simplify FQN.

@engcom-Golf
Copy link
Contributor Author

@magento run all tests

@engcom-Bravo
Copy link
Contributor

✔️ QA Passed

Manual testing scenario

  1. Create 2 websites, stores, store views
  2. Set price scope to website catalog > catalog > price > catalog price stope
  3. Configure Fixed Product Taxes as below. stores > config > sales > tax > Fixed Product Taxes
    image
  4. Create an FPT attribute and assign it to the default attribute set
    https://docs.magento.com/user-guide/tax/fixed-product-tax-configuration.html#step-2-create-an-fpt-attribute
  5. Create 4 simple products and set the FPT attribute value to Australia
  6. Create 2 bundled products with the following config
  • Define FPT
  • Dynamic price = no
  • set price to 100
  • bundle options shipped together, all marked as default with price type = fixed
  • add 2 of the simple products created in the previous step.
  1. Create a user account in the front end. Update the address with Australian address (set country to Australia, country which is used in FPT setup)
  2. Add the 2 bundled products to the cart
  3. Go to cart page and check the FPT is displaying correctly.
  4. Click checkout with multiple addresses or proceed to checkout
  5. Click on back and look at cart page FPT disappears

BEFORE applying changes provided in the PR, the FPT disappeared
before fix

AFTER switching to the PR, the FPT is included into the Summary
After fix

The order is placed successfully and the FPT is charged

@engcom-Bravo engcom-Bravo added the QA: Added to Regression Scope Scenario was analysed and added to Regression Testing Scope label Jan 8, 2021
@magento-engcom-team
Copy link
Contributor

Hi @coderimus, thank you for the review.
ENGCOM-8612 has been created to process this Pull Request
✳️ @coderimus, 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

@zakdma
Copy link
Contributor

zakdma commented Jan 13, 2021

@magento-engcom-team
Copy link
Contributor

@zakdma the branch with code successfully imported intomagento-tsg/magento2ce repository. Branch name: imported-magento-magento2-31563.

@magento-engcom-team magento-engcom-team merged commit fadc995 into magento:2.4-develop Jan 13, 2021
@m2-assistant
Copy link

m2-assistant bot commented Jan 13, 2021

Hi @engcom-Golf, 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
Labels
Award: test coverage Component: Quote Component: Weee Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Progress: ready for testing QA: Added to Regression Scope Scenario was analysed and added to Regression Testing Scope Release Line: 2.4 Severity: S3 Affects non-critical data or functionality and does not force users to employ a workaround. Type: Bug Fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

FPT disappears when switching back to the cart page
7 participants