Skip to content

Fix negative basket total due to shipping tax residue #13185

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

Conversation

torreytsui
Copy link
Contributor

@torreytsui torreytsui commented Jan 15, 2018

Description

A negative basket total is produced when:

  • tax was applied;
  • shipping was calculated and saved; and
  • basket is emptied

This PR fixes the issue by completing an earlier return on tax total collector that failed to unset taxed shipping total information.

negative-price

Fixed Issues (if relevant)

No directly related issue found

Manual testing scenarios

  1. Set up tax to 20%

  2. Set up tax settings like below

    tax-settings

  3. Sign in on front-end

  4. Add a default shipping address that will result in 20% tax rate

  5. Add a product to basket

  6. Go to checkout page

  7. Select default shipping address and select shipping method

  8. Step to billing (At this point, shipping tax should be calculated and show up on the breakdown)

  9. Go to basket page

  10. Empty the basket by removing the only product from it

Expected result

Basket total should become 0

Actual result

Basket total become negative (e.g., -1)

/customer/section/load/?sections=cart

DEMO

http://recordit.co/vERAS5KL1x

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)

@dmanners dmanners self-assigned this Jan 16, 2018
@dmanners dmanners added this to the January 2018 milestone Jan 16, 2018
@dmanners
Copy link
Contributor

Hi @torreytsui thank you for this pull request. I can see that an integration test to cover this case, or one to make sure that the negative case does not happen any more would be very beneficial here.

Would you be able to have a look into this for me?

@torreytsui
Copy link
Contributor Author

HI @dmanners, thanks for the reply. I'm still unable to replicate the issue on vanilla 2.2. It may be caused by some customisation. I will close this PR now.

@torreytsui torreytsui closed this Jan 16, 2018
@torreytsui
Copy link
Contributor Author

Hi @dmanners, I managed to replicate the issue on a vanilla 2.2 env. Updated the steps and could you please have a look and see if you can replicate it on your side?

@torreytsui torreytsui reopened this Jan 23, 2018
@dmanners
Copy link
Contributor

Thanks @torreytsui I will see what I can do and update you on the progress.

@magento-engcom-team
Copy link
Contributor

@torreytsui thank you for contributing. Please accept Community Contributors team invitation here to gain extended permissions for this repository.

@magento-engcom-team
Copy link
Contributor

Hi @torreytsui. Thank you for your contribution.
Changes from your Pull Request will be available with the upcoming 2.2.5 release.

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

Successfully merging this pull request may close these issues.

5 participants