0
有沒有辦法通過安裝文件和資源文件過濾自定義magento產品屬性?使magento自定義屬性可過濾
我可以創建屬性,我甚至可以設置它進入的組,但無法手動進入管理員和調整屬性的可過濾選項,我不能讓它被設置爲可過濾(尤其是可過濾 - 我嘗試了w/true/false和0,1,2)。我試着調整每個有意義的選項。
即:
app/code/local/Company/Module/Model/Resource/Eav/Mysql4/Setup.php
public function getDefaultEntities()
{
return array(
'catalog_product' => array(
'entity_model' => 'catalog/product',
'attribute_model' => 'catalog/resource_eav_attribute',
'table' => 'catalog/product',
'additional_attribute_table' => 'catalog/eav_attribute',
'entity_attribute_collection' => 'catalog/product_attribute
'attributes' => array(
'attribute_name' => array(
'group' => 'Attribute Set Group',
'type' => 'int',
'backend' => '',
'frontend' => '',
'label' => 'Attribute Label',
'input' => 'select',
'class' => '',
'source' => 'eav/entity_attribu
'global' => Mage_Catalog_Model_
'visible' => true,
'required' => false,
'user_defined' => true,
'default' => false,
'searchable' => true,
'filterable' => 1,
'comparable' => false,
'visible_on_front' => true,
'visible_in_advanced_search' => true,
'used_in_product_listing' => true,
'used_for_sort_by' => true,
'unique' => false,
),
),
),
);
}
app/code/local/Company/Module/Model/sql/module_setup/mysql4-install-0.1.0.php
$this->installEntities();
是否應該有一個'option'鍵來使這個屬性使用Multiple Select? – 2012-08-15 03:16:03
可以肯定的是,創建後清除緩存和重建索引? – 2012-08-15 03:17:40
不需要'option'標籤 - 它不是多選,我已經清除了緩存並重新編制了所需的內容。不過,我可以保證索引不是可過濾的問題。當我運行我的更新屬性設置爲離開'catalog_eav_attribute'表記錄w /'is_filterable = 0'。爲了解決這個問題,我需要在我的資源文件中添加'$ this-> updateAttribute('catalog_product','attribute_name','is_fiterable',1);'。現在我只是好奇,如果我可以在Setup.php文件中做到這一點或不是?感覺像調整可篩選選項應該工作。 – veilig 2012-08-15 04:14:33