【问题标题】:add a new column for special price in grid in admin panel in magento在 magento 的管理面板的网格中添加一个新的特价列
【发布时间】:2011-02-04 11:07:42
【问题描述】:

我正在 Magento 1.4.2 中设计一个管理模块。我正在开发一个显示产品详细信息(产品名称、SKU、价格、特价、数量)的网格布局,我显示了所有列。我不知道如何在一列中显示特价。我无法检索特价。帮我解决这个问题。

我使用此代码获取价格。

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

此代码用于添加价格列。

$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
            ));

但我不能为特价做同样的事情。

【问题讨论】:

  • 还请说明您如何为此网格准备集合。

标签: php magento e-commerce mage


【解决方案1】:
        $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',
    ));

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-09-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-03-30
    • 1970-01-01
    相关资源
    最近更新 更多