Próbuję dodać dodatkową kategorię attrbiute do zakładki informacji ogólnych. Próbowałem dodać to za pomocą następującego kodu,
require_once("app/Mage.php");
Mage::app('default');
Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
$installer = new Mage_Eav_Model_Entity_Setup('core_setup');
$entityTypeId = $installer->getEntityTypeId('catalog_category');
$attributeSetId = $installer->getDefaultAttributeSetId($entityTypeId);
$attributeGroupId = $installer->getDefaultAttributeGroupId($entityTypeId, $attributeSetId);
$installer->addAttribute('catalog_category', 'nav_left', array(
'type' => 'tinyint',
'label' => 'Show in left navgigation',
'input' => 'boolean',
'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
'visible' => true,
'required' => false,
'user_defined' => false,
'default' => 0
));
$installer->addAttributeToGroup(
$entityTypeId,
$attributeSetId,
$attributeGroupId,
'nav_left',
'11'
//last Magento's attribute position in General tab is 10
);
$attributeId = $installer->getAttributeId($entityTypeId, 'nav_left');
$installer->run("
INSERT INTO `{$installer->getTable('catalog_category_entity_int')}`
(`entity_type_id`, `attribute_id`, `entity_id`, `value`)
SELECT '{$entityTypeId}', '{$attributeId}', `entity_id`, '1'
FROM `{$installer->getTable('catalog_category_entity')}`;
");
To po prostu działa dobrze, ale jest to dodanie dodatkowej karty informacji o nazwie Generalpo prawej stronie. general infomation tabPróbowałem dodać ją do pierwszej karty, używając attributeGroupIdustawienia 4, ale po przetestowaniu powoduje to awarię witryny.
Każdy pomysł, jak mogę dodać ten atrybut do pierwszej karty.