-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Products added to cart with REST API give total prices equal to zero #11458
Merged
magento-team
merged 4 commits into
magento:2.2-develop
from
peterjaap:fix-for-issue-2991
Oct 31, 2017
Merged
Products added to cart with REST API give total prices equal to zero #11458
magento-team
merged 4 commits into
magento:2.2-develop
from
peterjaap:fix-for-issue-2991
Oct 31, 2017
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…nable getting a correct price through the (web) API after adding a product to an empty cart
…nable getting a correct price through the (web) API after adding a product to an empty cart
…hod does not exist for a billing address. Also removed getBillingAddress() call because the empty address is already created 3 lines above.
Hi @peterjaap |
okorshenko
added
2.2.x
bug report
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
Component: Sales
labels
Oct 16, 2017
@okorshenko I have no idea why the unit test fails; the address is created 2 lines right above where the setCollectShippingRates() is called... |
I will fix the tests |
magento-team
pushed a commit
that referenced
this pull request
Oct 31, 2017
… equal to zero #11458 - fixed unit tests
magento-team
pushed a commit
that referenced
this pull request
Oct 31, 2017
magento-team
pushed a commit
that referenced
this pull request
Oct 31, 2017
[EngCom] Public Pull Requests - 2.2-develop - MAGETWO-82955: [Backport 2.2-develop] FIX show visual swatches in admin - product attribute #11747 - MAGETWO-82943: Magetwo 70954: Remove the component.clear from the custom options type. This causes the 'elem' array to become out of sync with the recordData #11824 - MAGETWO-82710: Fix issue #10032 - Download back-up .tgz always takes the latest that's created (2.2-develop) #11595 - MAGETWO-81994: Products added to cart with REST API give total prices equal to zero #11458 - MAGETWO-81422: #11211 Fix Store View switcher #11337
@peterjaap I experienced the same bug with a logged in customer. In that case it uses the "createEmptyCartForCustomer" method. Your fix also works for that method. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
bug report
bugfix
Component: Sales
Progress: needs update
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Products added to cart with REST API give total prices equal to zero
Description
When adding a product trough the (web) API to an empty cart, the product gets a price of zero.
To quote @degaray in #2991 (comment), "The problem is here:
Magento\Quote\Model\Quote\TotalsCollector::collect
because all totals are set to zero and then all totals are calculated per address set. Since no address is set, then no totals are calculated, and as result, it does not calculate any total."Adding these collect shipping method calls will set a blank address, and cause the price to show up correctly.
Fixed Issues (if relevant)
Related Issues
Manual testing scenarios
Contribution checklist
(sorry for the commits mess, apparently I suck at rebasing)