How can add custom options title in drop down of product in magento


Located in app/code/core/Mage/Catalog/Block/Product/View/Options/Type/Select.php

find this function in above file “public function getValuesHtml()”

now in second if loop you can see this select method

$select->setName(‘options[‘.$_option->getid().’]’)
                    ->addOption(”, $this->__(‘– Please Select –‘));

add this line at above of code

$getOptionName = ucwords($_option->getTitle());

now code look like as

$getOptionName = ucwords($_option->getTitle());
$select->setName(‘options[‘.$_option->getid().’]’)
->addOption(”, $this->__(‘– Please Select ‘.$getOptionName.’ –‘));

Now go to frontside and option name will be display in drop down.

For reference

http://docs.magentocommerce.com/Mage_Catalog/Mage_Catalog_Block_Product_View_Options_Type_Select.html

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s