Hello I am simply trying to find the array of defaults for the product custom-option date

my goal is to change the month from "01,02,03....12" to a string with the month name "Jan. , Feb. , Mar. - Dec."

I believe I found the date custom-option file in


and in there you see the 'month' array being called but I can't find the declaration file.

I am new to this stuff so pardon my ignorance if this is obvious or I am making it more convoluted.


The month select is generated in the method Mage_Catalog_Block_Product_View_Options_Type_Date::getDropDownsDateHtml by the line $monthsHtml = $this->_getSelectFromToHtml('month', 1, 12);.
You can change that to something that fits your needs.

or you can do an ugly thing and change the dropdown texts via some javascript after the page loads.

| improve this answer | |

Go to


and add the below code into Date.php file.

Mage_Catalog_Block_Product_View_Options_Type_Date (its better to rewrite it in local)

protected function _getMonthSelectFromToHtml($name, $from, $to, $value = null)
        $options = array(
                array('value' => '', 'label' => '-')
        for ($i = $from; $i <= $to; $i++) {
                $options[] = array('value' => $i, 'label' => Zend_Locale::getTranslation($i, 'Month', Mage::app()->getLocale()->getLocaleCode()));
        return $this->_getHtmlSelect($name, $value)

then find out

$monthsHtml = $this->_getSelectFromToHtml('month', 1, 12);

and replace with below code:

$monthsHtml = $this->_getMonthSelectFromToHtml('month', 1, 12);

Hope this helps.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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