Search code examples
phpmagentomagento-soap-api

Magento SOAP API v2: Setting product options in cart


I’m working with the Magento SOAP API. My goal is, to create a product with custom options, then place it in to the cart of the customer. The custom options are 'fields' and are required.

All is going fine, except the setting of the options in the cart. The API gives my an exception: the required options has to be set.

As far as I can go, the OptionID of the option is good. Also the array of options is fine. Although that part is not so clear in the documentation: http://www.magentocommerce.com/api/soap/checkout/cartProduct/cart_product.add.html

Can anybody point me to a working example of the options part?

Thanks in advance, Maarten


Solution

  • Encountered a similar problem and the solution can be found in this answer - Setting Custom Options while adding a product to cart via SOAP in Magento

    The example code given on Magento's SOAP page for cart_product.add is faulty.