Skip to content

Configurable product addtocart with restAPI not working as expected #15028

@ghost

Description

Addtocart using same API work fine for simple product, but while adding configurable product with restAPI, it creates duplicate product entry in cart, it should ideally update the qty.
Using single store and quote id is also same.

Preconditions

  1. Magento 2.2.3 (with sample data)

Steps to reproduce

  1. Addtocart a configurable product from frontend.

image

  1. Create quote id with customer token, (http://local.magento.com/rest/default/V1/carts/mine)

  2. Addtocart same configurable product with rest API (http://local.magento.com/rest/default/V1/carts/mine/items)

Requets: { "cartItem": { "sku": "MJ12", "qty": 1, "quote_id": "11", "product_option": { "extension_attributes": { "configurable_item_options": [ { "option_id": "142", "option_value": "167" }, { "option_id": "93", "option_value": "49" } ] } } } }

Expected result

In cart there should be single product with two qty.

Actual result

image

Metadata

Metadata

Labels

Fixed in 2.1.xThe issue has been fixed in 2.1 release lineFixed in 2.2.xThe issue has been fixed in 2.2 release lineFixed in 2.3.xThe issue has been fixed in 2.3 release lineIssue: Clear DescriptionGate 2 Passed. Manual verification of the issue description passedIssue: Format is validGate 1 Passed. Automatic verification of issue format passed

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions