Delete Custom Options of a Product in Magento 1
Please use the following code to delete custom options of a product in Magento 1
$productId = 1; $product = Mage::getModel('catalog/product); if($product->getOptions() != ''){ foreach ($product->getOptions() as $option) { $option->delete(); } $product->setHasOptions(0)->save(); }
$option->delete() will delete the custom options.
Don’t forget to set setHasOptions to 0 before saving the product.
Happy coding 🙂
Be the first to comment.