magento2 - 如何在使用 API 下订单之前更改货币代码
问题描述
我需要更改报价货币以从移动应用程序订购。我尝试通过以下 API 将报价货币从 GBP 转换为 USD,但没有成功。它只是将产品添加到购物车,我不知道这是更改货币代码的正确方法。帮我解决这个问题。提前致谢
URL : /rest/V1/carts/mine
Method : PUT
Payload :
{
"quote": {
"id": 627,
"items": [
{
"sku": "DISS",
"qty": 1,
"quote_id": "627"
}
],
"customer": {
"id": 9,
"email": "sample@gmail.com",
"firstname": "fname",
"lastname": "lname"
},
"billing_address": {
"region": "",
"region_id": 0,
"region_code": "",
"country_id": "GB",
"street": [
"strrret"
],
"telephone": "44",
"postcode": "",
"city": "city",
"firstname": "fname",
"lastname": "lname",
"email": "sample@gmail.com"
},
"currency": {
"global_currency_code": "GBP",
"base_currency_code": "GBP",
"store_currency_code": "GBP",
"quote_currency_code": "USD",
"store_to_base_rate": 1,
"store_to_quote_rate": 1,
"base_to_global_rate": 1,
"base_to_quote_rate": 1.34
},
"customer_is_guest": false
}
}
解决方案
推荐阅读
- deep-learning - UNet 模型准确率精确地停留在 0.5(或多或少)(没有类不平衡,尝试调整学习率)
- ejb - JUnit5:如何在所有其他测试之前进行 EJB 初始化?
- c# - asp.net core 3.1 如何使用 appsettings.json 中的 AppSettings 实现 ConfigurationProperty
- elasticsearch - Elasticsearch 排除多个术语的关联
- mysql - SELECT WHERE VARCHAR 给我带来的只是价值存在
- javascript - 命名空间 own-props 与 state-props 分开是一种有用的模式吗?
- java - 我需要帮助处理 JUnit 测试和 CDI 事件
- assembly - 装配冒泡排序算法
- vb.net - For Next 循环中的 If else 语句有问题
- php - 如何从 Yii2 Gridview 值调用模型函数