I am trying to add my simple product with custom options in cart.
$post = $this->getRequest()->getPost();
$_product = Mage::getModel('catalog/product')->load(8);
$QuoteId= Mage::getModel('checkout/cart_api')->create('default');
$storeId = Mage::app()->getStore()->getId();
$arrProducts = array(
array(
"product_id" => 8,
"qty" => 1,
"options" => array(
'1' => array(
'sku' => 'cheese'
)
)
)
);
$cart = Mage::getSingleton('checkout/cart');
$cart->addProduct($_product, $arrProducts);
$cart->save();
Mage::getSingleton('checkout/session')->setCartWasUpdated(true);
but unfortunately product dont adding in cart. i have got error
"Please specify the product required option(s)"
what i am doing wrong ? I have two options for product. option 1 id is 1 and sku cheese ...