문제

Is there a way to run such a code at the launch of a module (once) to add fields in a table in the database

$setup = new Mage_Eav_Model_Entity_Setup ('core_setup');
$setup-> addAttribute ('customer', 'flavor', array (
'label' => 'Ice Cream Flavour'
'type' => 'varchar',
'input' => 'text',
'visible' => true,
'required' => true,
'position' => 1,
));

Thanks a lot for help.

도움이 되었습니까?

해결책

You want to look into Magento Setup Resources. This is exactly what they were created for.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top