Is it possible to set the default view view label using my script attribute in magento

I use the module to create a new attribute in the client model. Does anyone know how to set the default repository view using my script setup?

admin screenshot

My current script:

$setup = new Mage_Customer_Model_Resource_Setup('customer_setup'); if (! $setup->getAttribute('customer', 'dob_month')) { $setup->addAttribute('customer', 'dob_month', array( 'label' => 'Month', 'type' => 'varchar', 'input' => 'select', 'source' => 'eav/entity_attribute_source_table', 'required' => true, 'position' => 1, 'option' => array ( 'values' => array ( 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December' ) ) )); } 
+4
source share
1 answer

As far as I know, this cannot be done directly in the addAttribute() call. But you can set the vault labels after saving the attribute as follows:

 $attributeId = $this->getAttributeId('customer', 'dob_month'); $attribute = Mage::getModel('eav/entity_attribute')->load($attributeId); $attribute->setStoreLabels(array(store_id => 'Store label')) ->save(); 
+9
source

Source: https://habr.com/ru/post/1434926/


All Articles