Webkul
Services
Technologies Bagisto QloApps
iOS Android SAP BigCommerce Wix
Trusted by
Samsung Intel Toyota Walmart Disney Nokia Nestlé Decathlon
See all customers
Back to Top
DEV

Delete Custom Options of a Product in Magento 1

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 🙂

. . .

Leave a Comment

Your email address will not be published. Required fields are marked*


Be the first to comment.

Back to Top

Message Sent!

If you have more details or questions, you can reply to the received confirmation email.

Back to Home