In previous post, I added the the attribute event_date_time to catalog. I needed to add that attribute as field in a tab extension. So I added this code in the tab script to get it. The first line is the most important to tell to Magento that the field should have the time too.
$dateTimeFormatIso = Mage::app()->getLocale()->getDateTimeFormat(Mage_Core_Model_Locale::FORMAT_TYPE_SHORT); $fieldset->addField('event_date_time', 'datetime', array( 'label' => $hlp->__('Event date'), 'title' => $hlp->__('Event date'), 'time' => true, 'name' => 'product[event_date_time]', 'image' => $this->getSkinUrl('images/grid-cal.gif'), 'format' => $dateTimeFormatIso, 'required' => true, ));
Use this code in an installer or upgrade script. The backend key is the most important otherwise the time is not saved at all.
$installer = $this; $setup = new Mage_Eav_Model_Entity_Setup('core_setup'); $installer->startSetup(); $setup->addAttribute('catalog_product', 'event_date_time', array( 'group' => 'Deal Info', 'input' => 'datetime', 'type' => 'datetime', 'time' => true, 'label' => 'Event date', 'backend' => "eav/entity_attribute_backend_time_created", 'visible' => true, 'required' => false, 'user_defined' => true, 'searchable' => true, 'filterable' => false, 'comparable' => false, 'visible_on_front' => true, 'visible_in_advanced_search' => false, 'is_html_allowed_on_front' => false, 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL, ));
- create a git user and add shared keys of each developer
- create a bare repository using
git --bare init
- create a working repository in the live or development site using
- add the shared remote repository in the live or development site using
git remote add origin git@server:/path/to/repo.git
- push the development or live site to the shared repository using
git push origin master
- clone the shared repo to the local machine
Magento database uses Innodb as storage engine and uses foreign keys to check the integrity between the tables. So, importing the sql dump will cause an integrity violation and we need to disable the integrity check before the import session.
Before importing the dump file, we need to insert this string at the beginning of the sql file itself:
SET FOREIGN_KEY_CHECKS = 0;
then save the file and eventually gzip it.
We can now proceed to the import process
To add a prefix to the magento order, invoice or credit number, it is possible to set it into the eav_entity_store table, column increment_prefix.It is necessary to set it for each store id , while the entity_type_id is 5 for orders, 6 for invoices, 8 for memos.
I was looking at some guides about the Magento’s module creator that is very helpful tool to create a module skeleton. On the developer’s github account, I was able only to download the latest version 0.0.9.2 (4 years old) that creates two modules for the frontend and backend and, the most important thing, it seems to not work on Magento 1.8.
While googling for a solution, I found the previous version on a forum and I’ve downloaded. It works perfectly and I’ve pushed it on my github account, so if anyone need it, here is the link: https://github.com/apedicdev/magento-module-creator