I am having custom options created for the products. I need to set some option as default for the custom option so that when user checks on the front end default option will be seen instead of "Please Select".

enter image description here

I found one Extension default state of custom option for simple products

But I am looking for if I can show at the place where I am creating the options.

2 Answers 2


Go to Mage/Catalog/Block/Product/View/Options/Type/Select.php::getValuesHtml()

Comment (in line no 59) the addOption part of

                ->addOption('', $this->__('-- Please Select --'));


/* ->addOption('', $this->__('-- Please Select --')); */

Hope this solves your issue.

  • Great idea. I just did this and it worked like a charm. I was looking at an extension that is $699 that does that (plus a little extra). Then, all you need to do is change the "order" of the values under the custom options. Thank you!
    – NotJay
    Jul 6, 2015 at 18:58
  • I made main product with 0 price, and all the custom product with actual price, Your option is real good to set default option in product details page, how about grid page, i am getting price 0, is there any option to update there?
    – manny
    Jan 11, 2016 at 12:54
  • not sure why experts like you will post one answer and dont reopen site at all, community need guys like you..... Jan 12, 2017 at 11:45

I suppose you have the product in that form:

    $product = Mage::getModel('catalog/product');

    $product->setWebsiteIds(array(1));//Your website id
    $product->setAttributeSetId(9);//Your attribute code

    $product->setName('A name');
    more attributes you want to set.

After that you need this code:

$optionInstance = $product->getOptionInstance()->unsetOptions();



protected function makeCustomOptions(){

        return $option = array(
            'title' => 'Licenses',
            'type' => 'drop_down',//That can be checkbox and more
            'is_require' => 0,//1 if required

            'values'=>array(//These are the options

                    'title'             => "30 Days",
                    'price'             => -5,
                    'price_type'        => "fixed",
                    'sku'               => "30"

                    'title'             => "365 Days",
                    'price'             => -3,
                    'price_type'        => "fixed",
                    'sku'               => "365"

                    'title'             => "730 Days",
                    'price'             => -2,
                    'price_type'        => "fixed",
                    'sku'               => "730"


And that's it.You can change whatever you want..

  • vbak, it doesn't answer a question. Pradeep asked how to choose one custom option as default to avoid having "Please Select" in frontend field. Dec 8, 2014 at 15:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.