This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* {@inheritDoc} | |
*/ | |
public function getConfigTreeBuilder() | |
{ | |
$treeBuilder = new TreeBuilder(); | |
$rootNode = $treeBuilder->root('my_root'); | |
$rootNode | |
->children() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$installer = new Mage_Eav_Model_Entity_Setup('core_setup'); | |
$entityTypeId = $installer->getEntityTypeId('catalog_product'); | |
// replace <my_attribute_code> with your attribute code | |
$idAttribute = $installer->getAttribute($entityTypeId, '<my_attribute_code>', 'attribute_id'); | |
$installer->updateAttribute($entityTypeId, $idAttribute, array( | |
'backend_type' => 'varchar' | |
)); | |
// let's see if it worked | |
$attribute = Mage::getModel('eav/entity_attribute')->loadByCode('catalog_product', '<my_attribute_code>'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$myDate = '07/10/12';//2012-07-10 | |
$format = Mage::app()->getLocale()->getDateFormat(Mage_Core_Model_Locale::FORMAT_TYPE_SHORT); | |
$date = Mage::app()->getLocale()->date( | |
$myDate, | |
Mage::app()->getLocale()->getDateFormat(Mage_Core_Model_Locale::FORMAT_TYPE_SHORT), | |
null, | |
false | |
); |