I am trying to change my order item custom options after order placed but it overwrite exitsting data and set only value that i did set previously. https://www.screencast.com/t/Y99dQ1D4 My code.
foreach ($orderIds as $key => $value) {
$orderModel = Mage::getModel('sales/order')->load($value);
$orderItem = $orderModel->getAllItems();
foreach ($orderItem as $item) {
if($item->getId()==17447){
$option = $item->getProductOptions();
$info = $intoByRequest['info_buyRequest']['additional_options']['item_shippinggroup'];
$info = 'group1';
$item->setProductOptions(serialize($info))
}
}
can anyone please guide me how i would change one array element and save the item.
save
in your code like$item->setProductOptions(serialize($info))->save();