eseguire questo script nella vostra cartella principale di Magento per creare attributo
<?php
require_once('app/Mage.php');
Mage::app()->setCurrentStore(Mage::getModel('core/store')->load(Mage_Core_Model_App::ADMIN_STORE_ID));
$installer = new Mage_Eav_Model_Entity_Setup('core_setup');
$installer->startSetup();
$entityTypeId = $installer->getEntityTypeId('catalog_category');
$attributeSetId = $installer->getDefaultAttributeSetId($entityTypeId);
if (!$installer->getAttributeId($entityTypeId, 'shipping_content')) {
$installer->addAttribute('catalog_category', 'shipping_content', array(
'type' => 'text',
'backend' => '',
'frontend' => '',
'label' => 'Short description',
'input' => 'textarea',
'class' => '',
'source' => '',
'global' => '0',
'visible' => true,
'required' => false,
'user_defined' => true,
'default' => '',
'searchable' => false,
'filterable' => false,
'comparable' => false,
'visible_on_front' => true,
'used_in_product_listing' => false,
'unique' => false,
'wysiwyg_enabled' => true,
'apply_to' => '',
'is_configurable' => true
));
$installer->updateAttribute($entityTypeId, 'shipping_content', 'is_wysiwyg_enabled', 1);
$installer->updateAttribute($entityTypeId, 'shipping_content', 'is_html_allowed_on_front', 1);
}
$installer->endSetup();
?>
Per Rimuovi categoria Attributo
<?php
require_once('app/Mage.php');
Mage::app()->setCurrentStore(Mage::getModel('core/store')->load(Mage_Core_Model_App::ADMIN_STORE_ID));
$installer = new Mage_Sales_Model_Mysql4_Setup;
$installer->startSetup();
$installer->removeAttribute('catalog_category', 'shipping_content');
$installer->endSetup();
?>
fonte
2016-11-17 05:05:12
Puoi condividere i nomi dei file e il codice dallo script di installazione? – Hum
utilizzando mysql4-install-0.0.1.php e config.xml –