4

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

2

1 Answer 1

2

I would recommend simple configurable products

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

1
  • Thank you but I need do this action programmatically
    – mahdi
    Nov 17, 2014 at 13:13

This site is temporarily in read-only mode and not accepting new answers.

Not the answer you're looking for? Browse other questions tagged .