how can i add Configurable Product to shopping cart in magento ? i try this code to add simple product to shopping cart but it`s not work for configurable product

    $result = $proxy->shoppingCartProductAdd($sessionID, $cartID, array(array(
    'product_id' => $productID,
    'sku' => $sku,
    'qty' => $qty,
    'options' =>array(0 =>array('key' => $option1id ,'value' => $option1value),1 =>array('key'     => $option2id ,'value' => $option2value)),
    'bundle_option' => null,
    'bundle_option_qty' => null,
    'links' => null

how can i do this for configurable products ? thanks

edit : i change my code :

        $product = array(
    "product_id" =>"1300",
    "qty" => 2,
    "super_attribute" => array(         
        152 => 28

 $result = $proxy->shoppingCartProductAdd($sessionID, $cartID, array($product));

but it`s return me this message :

please specify product options

152 is attribute id and 28 is option value id


I would recommend simple configurable products

It works with magento You can determine whether the simple or the configurable product is being added to the cart.

| improve this answer | |
  • Thank you but I need do this action programmatically – mahdi Nov 17 '14 at 13:13

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.