I need to update the custom option value using ajax.
I am trying to update it like
$params = $this->getRequest()->getParams();
$itemID = $params['item'];
$item = Mage::getSingleton('checkout/session')->getQuote()->getItemById($itemID);
$options = $item->getOptions();
foreach ($options as $option) {
if(strtolower($option->getCode()) == 'info_buyRequest')
{
$unserialized = unserialize($option->getValue());
$unserialized['options'][216]= 'New Value';
$option->setValue(serialize($unserialized));
}
}
$item->save();
Can any one help me abt what is going wrong here.
Thanks
Pravin got it worked with below lines of code.
Thanks p4pravin for sharing.