I have tried to add the products to cart using custom module. Below is the code i used
$product_id = $this->getRequest()->getParam('product');
$product = Mage::getModel('catalog/product')->load($product_id);
$param = array( 'product' => $product->getId(), 'qty' => 2,'options["'.$option_id.'"]' => $option_type_id );
$cart = Mage::getModel('checkout/cart')->init();
$cart->addProduct($product, new Varien_Object($param));
Mage::getSingleton('checkout/session')->setCartWasUpdated(true);
$cart->save();
I can add the products name, quantity to cart using product id, But i cannot able to add the products custom options in cart.
Please give me a hand on this.
Thanks, Prakash