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.

asked Aug 28, 2014 at 7:23
4
  • can you put your code. Commented Aug 28, 2014 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)); Commented Aug 28, 2014 at 7:26
  • are you doing on configurable product ya bundle? Commented Aug 28, 2014 at 7:29
  • need to add all type of products via soap including - configurable, bundle and grouped. just trying to start with configurable products. Commented Aug 28, 2014 at 7:33

1 Answer 1

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.
 .....
 )
answered Aug 28, 2014 at 7:42
6
  • works like charm :) :) You saved my day. Can you please give me an example of product array for bundled and grouped too? Commented Aug 28, 2014 at 8:10
  • accepted. Any idea about grouped and bundled? Commented Aug 28, 2014 at 8:19
  • sure.give u idea sortly Commented Aug 28, 2014 at 8:23
  • Is this working for associating simple to configurable products? Commented Sep 12, 2014 at 8:00
  • i use this code but it return me this message : please specify product options Commented Nov 17, 2014 at 9:43

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.