Ich benutze Modul Setup-Skript, um neue Attribute Gruppe, Attributsatz und Attribute hinzuzufügen. Ich bin in der Lage, Attributgruppe, Attributgruppe zu erstellen und Produkte zu Gruppe/Gruppe hinzuzufügen. Aber ich habe harte Zeit einstellen is_filterable, is_visible, is_visible_on_front und is_html_allowed_on_front Parameter.Hinzufügen von benutzerdefinierten Produktattributen in Magento mit Setup-Skript
$installer->addAttribute('catalog_product', 'offer_type', array(
'backend' => '',
'frontend' => '',
'class' => '',
'default' => '',
'label' => 'Offer type',
'input' => 'text',
'type' => 'int',
'source' => '',
'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
'visible' => 1,
'required' => 1,
'searchable' => 0,
'filterable' => 1,
'unique' => 0,
'comparable' => 0,
'visible_on_front' => 1,
'is_html_allowed_on_front' => 1,
'user_defined' => 1,
));
$installer->addAttributeToSet('catalog_product', $sSetId, $groupName, 'offer_type');
Ich sehe offer_type zu Magento immer hinzugefügt und auf das Attribut ($ sSetID) und Gruppe ($ Gruppenname). Obwohl ich Attribute von Magento Admin UI (Katalog-> Attribute-> Attribute verwalten) sehe, sehe ich is_filterable, is_visible, is_visible_on_front und is_html_allowed_on_front Parameter auf Nein gesetzt. Ich habe verschiedene Kombinationen ausprobiert, aber kein Glück. Ich benutze Magento CE 1.7.0.2. Ich bin mir nicht sicher, was in meinem Setup-Skript fehlt. Ich habe http://blog.chapagain.com.np/magento-adding-attribute-from-mysql-setup-file/ dafür angegeben. Fehle ich etwas? Vielen Dank im Voraus.
Danke! Problem gelöst. – sukkad
Irgendeine Idee, wie man is_visible_on_front setzt? Obwohl ich es in addAttribute call ('is_visible_on_front' => 1) auf 1 setze, sehe ich keine Änderung in DB/admin. – sukkad