Description
Summary (*)
Currently i'm using POST /V1/carts/mine/items rest api endpoint to add products to carts.
So for grouped product if use the payload as mentioned in devdoc then this picks the default quantity which is used in adminhtml to add those products to cart.
So if i want to add custom quantity for each product to add to cart, i am unable to use "product_option" in payload for grouped product to specify individual quantity as i do for other product types.
Examples (*)
This is the payload mentioned on swagger for above api to add products to cart.
{
"cartItem": {
"item_id": 0,
"sku": "string",
"qty": 0,
"name": "string",
"price": 0,
"product_type": "string",
"quote_id": "string",
"product_option": {
"extension_attributes": {
"custom_options": [
{
"option_id": "string",
"option_value": "string",
"extension_attributes": {
"file_info": {
"base64_encoded_data": "string",
"type": "string",
"name": "string"
}
}
}
],
"bundle_options": [
{
"option_id": 0,
"option_qty": 0,
"option_selections": [
0
],
"extension_attributes": {}
}
],
"configurable_item_options": [
{
"option_id": "string",
"option_value": 0,
"extension_attributes": {}
}
],
"downloadable_option": {
"downloadable_links": [
0
]
},
"giftcard_item_option": {
"giftcard_amount": "string",
"custom_giftcard_amount": 0,
"giftcard_sender_name": "string",
"giftcard_recipient_name": "string",
"giftcard_sender_email": "string",
"giftcard_recipient_email": "string",
"giftcard_message": "string",
"extension_attributes": {}
}
}
},
"extension_attributes": {
"negotiable_quote_item": {
"item_id": 0,
"original_price": 0,
"original_tax_amount": 0,
"original_discount_amount": 0,
"extension_attributes": {}
}
}
}
}
How am i supposed to add grouped product with individual quantity specified for the products in group product.
Proposed solution
There should be another key in "product_option" for grouped products to specify quantity.
Well if i use PUT /V1/carts/mine/items endpoint to update the quantity for products using item id after adding them, then i get the desired result.
So this approach is difficult to follow on mobile end and is also very slow.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status