Magento V1.7网格视图-将制造商属性添加到视图 [英] Magento V1.7 Grid View - Add manufacturer attribute to view

查看:45
本文介绍了Magento V1.7网格视图-将制造商属性添加到视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

此页面上在项目名称的正下方添加制造商名称,但似乎无法正常使用.尝试了许多建议,但似乎都没有用.

On this page I want to add the Manufacturer name directly below the name of the item, but can't seem to get this to work. Have tried a number of suggestions, but none seem to work.

请具体说明文件和要编辑的行.

Please be specific on the file and lines to edit.

推荐答案

$manufacturer_items = Mage::getModel('eav/entity_attribute_option')->getCollection()->setStoreFilter()
    ->join('attribute','attribute.attribute_id=main_table.attribute_id', 'attribute_code');

    foreach ($manufacturer_items as $manufacturer_item) :
        if ($manufacturer_item->getAttributeCode() == 'manufacturer')
        $manufacturer_options[$manufacturer_item->getOptionId()] = $manufacturer_item->getValue();
    endforeach;

    $this->addColumn('manufacturer',
        array(
        'header'=> Mage::helper('catalog')->__('Manufacturer'),
        'width' => '100px',
        'type'  => 'options',
        'index' => 'manufacturer',
        'options' => $manufacturer_options,
        ));

将此代码放置在Gird.php文件中,并将此代码放置在同一文件的第58至63行之间 -> addAttributeToSelect('manufacturer')

Put this code in Gird.php file and this code in apoximate line number 58 to 63 in same file ->addAttributeToSelect('manufacturer')

这篇关于Magento V1.7网格视图-将制造商属性添加到视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆