2

Trying to add configurable product in magento cart using magento soap api V1 but not able to add the products. can anyone please let me know the way how to do it. Any help would be appreciated.

  • can you put your code. – Amit Bera Aug 28 '14 at 7:24
  • This is how i am doing it - $arrProducts = array( 'product_id' => "120", 'sku' => 'ink', 'qty' => '1', 'options' => array( 'key' => 525, 'value' => 99 ), 'bundle_option' => null, 'bundle_option_qty' => null, 'links' => null ); $resultCartProductAdd = $proxy->call($sessionId, "cart_product.add", array($shoppingCartId, $arrProducts)); – vibhu Aug 28 '14 at 7:26
  • are you doing on configurable product ya bundle? – Amit Bera Aug 28 '14 at 7:29
  • need to add all type of products via soap including - configurable, bundle and grouped. just trying to start with configurable products. – vibhu Aug 28 '14 at 7:33
4

For add to cart of configurable product,you need to super attribute value. in my below if only one super attribute so in super_attribute i have set one value

$quoteId = $client->call( $session, 'cart.create',array( 'default' ));
$arrProducts = array(
    array(
        "product_id" =>"21",
        "qty" => 2,
                "super_attribute" => array(         
                    92 => 162

                 )
    )

);



$resultCartProductAdd = $client->call(
    $sessionId,
    "cart_product.add",
    array(
        $quoteId,
        $arrProducts
    )
);

here 92 is attribute id and 162 it option id if you have more then one variance for then

"super_attribute" => array(         
                    first_attribute_id => first_chose_option_value
                     seocnd_attribute_id => seocnd_chose_option_value.
                     .....



                 )
  • works like charm :) :) You saved my day. Can you please give me an example of product array for bundled and grouped too? – vibhu Aug 28 '14 at 8:10
  • accepted. Any idea about grouped and bundled? – vibhu Aug 28 '14 at 8:19
  • sure.give u idea sortly – Amit Bera Aug 28 '14 at 8:23
  • Is this working for associating simple to configurable products? – Adam Fili Sep 12 '14 at 8:00
  • i use this code but it return me this message : please specify product options – mahdi Nov 17 '14 at 9:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.