如何添加到购物车 当产品有选项时使用 API opencart 3.0.3.6

How to Add to cart use API opencart 3.0.3.6 when the product have options

我正在开发一个使用 Opencart V3.0.3.6 的项目。现在我正在研究 API.
我的问题是。
当产品有一些变体时,如何使用 API 添加到购物车?

我使用 Postman 进行 API 测试。通过以下测试。

但我收到此错误消息:

{
    "error": {
        "option": {
            "228": "Radio required!",
            "229": "Checkbox required!",
            "230": "Select required!"
        }
    }
}

如果产品具有可通过 API 选择的款式,我该如何添加到购物车?

您至少需要在post请求中添加选项ID和选项值ID

你可以post它喜欢option[option_id]=option_value_id

例如

option[228]=123
option[229]=456
option[230]=789