Bri*_*n F 5 php attributes module magento
我已经搜索了相当多的答案,并且无法追查我需要的确切设置.我正在伸出手去看看是否有人可以提供帮助.
我正在写一个Magento扩展来为我的安装添加一些属性.一切都很好,除了一个错综复杂.我无法将属性的"在分层导航中使用"属性设置为"可过滤(无结果)".
我可以使用安装程序文件(下面)中属性数组中的值将该属性设置为"No"(0值)或"Filterable(with results)"(1值)但不是没有结果.
任何人都有一个我可能在我的阵列中丢失或设置不正确的属性的建议?
非常感谢!
<?php
...
// Add the mm_framestyle attr. (filterable, non-super attr.)
$setup->addAttribute('catalog_product', 'mm_framestyle', array(
'backend' => 'eav/entity_attribute_backend_array',
'visible' => true,
'required' => false,
'user_defined' => true,
'searchable' => true,
'filterable' => true,
'comparable' => true,
'label' => 'Frame Types',
'group' => 'MyMaui Attributes',
'type' => 'varchar',
'input' => 'select',
'global' => false,
'option' => array (
'value' => array('maui_flex' => array('MAUI FLEX'),
'full_frame_metal' => array('FULL FRAME'),
'rimless_metal' => array('RIMLESS'),
'shields' => array('SHIELDS'),
)
),
'visible_on_front' => true,
'unique' => false
));
...
?>
Run Code Online (Sandbox Code Playgroud)
要将is_filterable属性设置为"可过滤(无结果)",配置数组应filterable设置为2.
如果您希望使用更新脚本来更改先前建立的设置,则语法如下:
$setup->updateAttribute('catalog_product', 'mm_framestyle', 'is_filterable', 2);
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3482 次 |
| 最近记录: |