3

I can successfully add item to the cart using this rest API from my APP.

POST /V1/carts/mine/items

However the item is added with a price of ZERO.

The new quote was created from the APP using this API.

POST /V1/carts/mine

But when I try to add an item from magento web the price is showing correct value.

I am using magento 2 .

1
  • This was 5 months ago and was there any solution? Its disappointing that magento dev experts aren't addressing this issue
    – madi
    Commented Feb 23, 2017 at 8:44

2 Answers 2

5
Here is the solution of this issue

Open file 'vendor/magento/module-quote/Model/QuoteManagement.php'.
Find function 'createEmptyCartForCustomer'.
Add below code inside try{}  (at start of try), before line number 234
$quote->getBillingAddress();
$quote->getShippingAddress()->setCollectShippingRates(true);
After adding these 2 lines it will not show 0 price again.
0

Here is the solution of this issue follow below steps

step 1) Go to file 'vendor/magento/module-quote/Model/QuoteManagement.php'(override this file using preference dnt make chanage in core files)

step 2) Edit this function 'createEmptyCartForCustomer'.

step 3) In try before saving quote line number 234 add below code

$quote->getBillingAddress();
$quote->getShippingAddress()->setCollectShippingRates(true);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.