Frontend WebAPI product with required attribute

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
1 yıl önce
I'm trying to add a product to the shoppingcart using the webAPI, more specifically:

/api-frontend/ShoppingCart/AddProductToCartFromDetails/{productId}

On the attributes of the product I have a required one, which is returning the response:
{
  "errors": [
    "Please select Add Storage (ProductAttribute)"
  ],
  "success": false,
  "message": null,
  "model": null
}


Wath is the model to add the custom property to the body of the call?
{
  "additionalProp1": "string",
  "additionalProp2": "string",
  "additionalProp3": "string"
}

Best Regards,
Duarte Dória
1 yıl önce
In the simplest case, you just need to specify the quantity of the product to be added to the cart.
"addtocart_{your_productId}.EnteredQuantity": 1


You can see other possible parameters passed in the request body in the code of the
AddProductToCart_Details method.
1 yıl önce
RemoveFromCart would also be nice.  Using "updateCart" isn't working very easy.  Just that very  small documentation would be great sometimes.
1 yıl önce
Does anyone know how to use UpdateCart?
1 yıl önce
I had to debug the source code myself to find out what was needed to pass on the body, something like:

{
    "product_attribute_7": "18",
    "product_attribute_3": "14"
}

On the "AddProductToCartFromDetails"
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.