Skip to content

Instantly share code, notes, and snippets.

Anda B. abdev

Block or report user

Report or block abdev

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@abdev
abdev / gist:3083037
Created Jul 10, 2012
Magento - format date from local format to magento internal format
View gist:3083037
$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
);
@abdev
abdev / gist:2376792
Created Apr 13, 2012
Magento -update product attribute backend type
View gist:2376792
$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>');
@abdev
abdev / Configuration.php
Created Jul 27, 2012
Symfony2 array options config.yml parsing
View Configuration.php
/**
* {@inheritDoc}
*/
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('my_root');
$rootNode
->children()
You can’t perform that action at this time.