2

I checked this api:

rest/{{store_code}}/V1/carts/mine/totals

It will return Items in JSON response.

But if a cart is created in English Store in the very first place. And we try to switch the store by passing Arabic store code in above URL. It doesn't convert the Product Name into Arabic even if We provided Name in Arabic in Arabic store view from Backend.

In the following output, you will see the Item Name marked in Bold is not converted to Arabic store. It is just an example. In Magento 2, All Quote related APIs doesn't support localization.

json O/P:

{ "grand_total": 90, "base_grand_total": 90, "subtotal": 75, "base_subtotal": 75, "discount_amount": 0, "base_discount_amount": 0, "subtotal_with_discount": 75, "base_subtotal_with_discount": 75, "shipping_amount": 15, "base_shipping_amount": 15, "shipping_discount_amount": 0, "base_shipping_discount_amount": 0, "tax_amount": 0, "base_tax_amount": 0, "weee_tax_applied_amount": null, "shipping_tax_amount": 0, "base_shipping_tax_amount": 0, "subtotal_incl_tax": 75, "shipping_incl_tax": 15, "base_shipping_incl_tax": 15, "base_currency_code": "USD", "quote_currency_code": "USD", "items_qty": 3, "items": [ { "item_id": 912, "price": 25, "base_price": 25, "qty": 3, "row_total": 75, "base_row_total": 75, "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, "price_incl_tax": 25, "base_price_incl_tax": 25, "row_total_incl_tax": 75, "base_row_total_incl_tax": 75, "options": "[{\"value\":\"Italian Bread arabic\",\"label\":\"Bread arabic\"},{\"value\":\"Plain Bread\",\"label\":\"Customize\"},{\"value\":\"honey Mustard Sauce, Mustard Sauce\",\"label\":\"Sauces\"}]", "weee_tax_applied_amount": null, "weee_tax_applied": null, "name": " Aloo Patty " } ], "total_segments": [ { "code": "subtotal", "title": "Subtotal", "value": 75 }, { "code": "shipping", "title": "Shipping & Handling (Flat Rate - Fixed)", "value": 15 }, { "code": "tax", "title": "Tax", "value": 0, "extension_attributes": { "tax_grandtotal_details": [] } }, { "code": "grand_total", "title": "Grand Total", "value": 90, "area": "footer" } ] }

Is there any solution for this ?

Thanks in advance.

  • I have resolved this by getting only store id from store manager instead of store id from quote. – Vaibhav Munjpara Oct 12 '17 at 10:34
  • Updated following function in this file: vendor/magento/module-quote/Model/Quote.php public function getStoreId() { return $this->_storeManager->getStore()->getId(); } – Vaibhav Munjpara Oct 12 '17 at 12:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.