How can I use the add cart API to add a new line item instead of increasing quantity?

Solved

How can I use the add cart API to add a new line item instead of increasing quantity?

sancuscommerce
Shopify Partner
17 1 2

How can I use the add cart api (POST /{locale}/cart/add.js) to add a product to the cart as a new line item and not increase the quantity of the same item if it is in the cart.  I have properties that I am adding to the cart product and need to ensure each line item respects those values.

Accepted Solution (1)

gr_trading
Shopify Partner
1933 146 202

This is an accepted solution.

Hi @sancuscommerce ,

 

You have to add a property value in your query which should be unique in every request.

 

This will always create a new line item entry.

 

Hope this will work...

For any custom development WhatsApp or connect at Email ID: gr.trading15@gmail.com for quick consultation. | Shopify Free codes
To support Buy Me a Coffee

View solution in original post

Reply 1 (1)

gr_trading
Shopify Partner
1933 146 202

This is an accepted solution.

Hi @sancuscommerce ,

 

You have to add a property value in your query which should be unique in every request.

 

This will always create a new line item entry.

 

Hope this will work...

For any custom development WhatsApp or connect at Email ID: gr.trading15@gmail.com for quick consultation. | Shopify Free codes
To support Buy Me a Coffee