在magento的管理面板中的网格中为特殊价格添加新列 [英] add a new column for special price in grid in admin panel in magento

查看:106
本文介绍了在magento的管理面板中的网格中为特殊价格添加新列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在Magento 1.4.2中设计一个管理模块.我正在开发一个显示产品详细信息(产品名称,SKU,价格,特价,数量)的网格布局,并显示了所有列.我无法弄清楚如何在一栏中显示特惠价格.我无法获取特价.帮我解决这个问题.

I am designing an admin module in Magento 1.4.2. I am developing a grid layout displaying the product details (product name, SKU, price, special price, qty) I displayed all the columns. I cannot figure out how to display the special price in one column. I cannot retrieve the special price. Help me to solve this.

我使用此代码来获取价格.

I used this code for getting the price.

$collection->joinAttribute('price', 'catalog_product/price', 'entity_id', null, 'left', $store->getId());

此代码用于添加价格列.

This code I used for adding a column for price.

$this->addColumn('price', array(
            'header'    => Mage::helper('catalog')->__('Price'),
            'type'  => 'number',
            'width'     => '1',
            'currency_code' =(string)Mage::getStoreConfig(Mage_Directory_Model_Currency::XML_PATH_CURRENCY_BASE),
            'index'     => 'price',
         'editable' =>true
            ));

但是我不能以特殊的价格做同样的事情.

But I cannot do the same for special price.

推荐答案

        $collection->joinAttribute('special_price', 'catalog_product/special_price', 'entity_id', null, 'left', $store->getId());

,然后添加以下内容:

 $this->addColumn('special_price',
        array(
            'header'=> Mage::helper('catalog')->__('Special Price'),
            'type'  => 'price',
            'currency_code' => $store->getBaseCurrency()->getCode(),
            'index' => 'special_price',
    ));

这篇关于在magento的管理面板中的网格中为特殊价格添加新列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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