Hi Team,
I am using the V1/carts/mine/items REST API to add the Item in cart for mobile app.
I have configure minimum order amount setting 20$ under stores => configuration => Sales .
When I am trying to add the item in with some quantity Input Json Like
{
"cartItem": {
"sku": "33844005412",
"qty": 10,
"price": 15.0,
"product_type": "simple",
"quote_id": "412"
}
}
But I have some issues as here
1. Magento2 is not accepting the price that we have given in input json. magento2 is accepting the product price based on sku.
2. Magento 2 is not calculating the price with quantity . If I use qty=20, and supose product price is 3.4 then I am getting the Minimum order amount issue.
3. Is magento2 have any api that can accept multiple cart item in a single call. When I need to add 2-3 items Then I am calling same API 2-3 times, one time for each item
4. How can be the API performance improvment.
Kindly response me.
1. Magento2 is not accepting the price that we have given in input json. magento2 is accepting the product price based on sku. : for that you need to customize that othewise it will take magento default product price or sale price.
2. Magento 2 is not calculating the price with quantity . If I use qty=20, and supose product price is 3.4 then I am getting the Minimum order amount issue.
{
"cart_item": {
"quote_id": "1390",
"sku": "ENT-10",
"qty": 10
}
}
no it is working based on order total not based on item price, i checked and it is working.
3. Is magento2 have any api that can accept multiple cart item in a single call. When I need to add 2-3 items Then I am calling same API 2-3 times, one time for each item
i don't think that should be need, becuase customer click only one add to cart add a time.
Thanks for answer.
Exactly issue like this:
1. I have set minimum order amount $20 in admin
2. I created and cart using following API
http://localhost/magento/index.php/rest/V1/carts/mine
I got the "486" cart id
3. I then added an Item using following API
http://localhost/magento/index.php/rest/V1/carts/mine/items
Input: {"cartItem": {"quote_id": "486","sku": "7115378380","qty": 2}}
Product price is $ 5.30
And then getting the error message: "The minimum amount for the order must be $ 20"
Note: logically Item should be added in cart and when we are going to create the order then message should notify to us.
When I am increasing the quantity of the Item then it is adding.
So kindly suggest if you have any solution for this.