API returns quote totals data for a specified cart not properly working

by Cys2best   Last Updated September 16, 2019 09:09 AM

I'm using rest API of Magento ver 2.2.8 to develop a mobile app base on Reactjs.

Steps to reproduce

  1. Place order via API (carts/mine/payment-information)
  2. Create a new quote (carts/mine)
  3. Add product to cart (carts/mine/items)
  4. Get totals data of new quotes (carts/mine/totals)

This is responses when I used API get totals data of quotes (carts/mine/totals)

{"grand_total": 0,"weee_tax_applied_amount": null,"base_currency_code": "VND","quote_currency_code": "VND","items_qty": 1,"items": [{"item_id": 21800,"price": 169000,"base_price": 0,"qty": 1,"row_total": 0,"base_row_total": 0,"row_total_with_discount": 0,"tax_amount": 0,"base_tax_amount": 0,"tax_percent": 0,"discount_amount": 0,"base_discount_amount": 0,"discount_percent": 0,"options": "[]","weee_tax_applied_amount": null,"weee_tax_applied": null,"name": "Nước Pepsi - Thùng 24 lon x 330ml"}],"total_segments": [{"code": "subtotal","title": "Tổng phụ","value": null },{"code": "shipping","title": "Vận chuyển & xử lý","value": null },{"code": "tax","title": "Thuế","value": 0,"extension_attributes": {"tax_grandtotal_details": []}},{"code": "grand_total","title": "Tổng số","value": null,"area": "footer"}]}

I just found when I created a new quote (empty cart) in Magento just create one record in quote_address with address_type = billing. Normally, it must create 2 records one with address_type = billing and one with address_type = shipping.

Does anyone have a clue?

Related Questions

Updated February 19, 2017 11:09 AM

Updated October 17, 2016 09:03 AM

Updated July 09, 2019 13:09 PM

Updated January 18, 2019 13:09 PM

Updated November 29, 2018 07:09 AM