Sylius ShopApiPlugin 无法将产品添加到购物车

Sylius ShopApiPlugin Can't add products to cart

我正在尝试使用为 Sylius 制作的 ShopApiPlugin 将产品添加到我的购物车。 当我尝试通过 /carts/mytokenoid/items 和 json 正文添加产品时 { "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检查我的购物车内容时,它是空的,没有添加任何东西。我还检查了数据库,那里的购物车带有正确的令牌,但没有物品。 有谁知道我该如何解决这个问题?我已经尝试过使用和不使用授权令牌。得到了同样的东西

找到解决方案。 您只需取消注释 config/packages/league_tactician.yaml

中的“- tactician.middleware.doctrine”行