【发布时间】:2018-12-27 16:18:52
【问题描述】:
我正在尝试使用为 Sylius 制作的 ShopApiPlugin 将产品添加到我的购物车。
当我尝试使用 json 正文通过 /carts/mytokenoid/items 添加产品时
{
"productCode": "iphone9",
"quantity": 5
}
我收到此回复
{
"tokenValue": "mytokenoid",
"channel": "US_WEB",
"currency": "EUR",
"locale": "en_US",
"checkoutState": "cart",
"items": [
{
"quantity": 5,
"total": 4800,
"product": {
"code": "iphone9",
"name": "iPhone 9",
"slug": "iphone-9",
"averageRating": 0,
"taxons": {
"others": []
},
"variants": [
{
"code": "iphone9",
"axis": [],
"nameAxis": [],
"price": {
"current": 2000,
"currency": "EUR"
},
"images": []
}
],
"attributes": [],
"associations": [],
"images": []
}
}
],
"totals": {
"total": 6896,
"items": 4800,
"taxes": 0,
"shipping": 2096,
"promotion": -5200
}, (...)
但是当我使用/shop-api/carts/mytokenoid 检查我的购物车内容时,它是空的,没有添加任何内容。我还检查了数据库,购物车在那里有正确的令牌但没有物品。
有谁知道我该如何解决这个问题?我已经尝试过使用授权令牌和没有。有同样的事情
【问题讨论】: