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– Amit Bera ♦2014年08月28日 07:24:30 +00:00Commented 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));vibhu– vibhu2014年08月28日 07:26:53 +00:00Commented Aug 28, 2014 at 7:26
-
are you doing on configurable product ya bundle?Amit Bera– Amit Bera ♦2014年08月28日 07:29:15 +00:00Commented 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.vibhu– vibhu2014年08月28日 07:33:05 +00:00Commented Aug 28, 2014 at 7:33
1 Answer 1
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– vibhu2014年08月28日 08:10:53 +00:00Commented Aug 28, 2014 at 8:10
-
accepted. Any idea about grouped and bundled?vibhu– vibhu2014年08月28日 08:19:48 +00:00Commented Aug 28, 2014 at 8:19
-
sure.give u idea sortly2014年08月28日 08:23:03 +00:00Commented Aug 28, 2014 at 8:23
-
Is this working for associating simple to configurable products?Adam Fili– Adam Fili2014年09月12日 08:00:35 +00:00Commented Sep 12, 2014 at 8:00
-
i use this code but it return me this message : please specify product optionsmahdi– mahdi2014年11月17日 09:43:58 +00:00Commented Nov 17, 2014 at 9:43