2011-02-04 77 views
3

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

我使用此代码获取价格。

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

但我不能这样做的特殊价格。

+4

也请告诉你如何准备集合此网格。 – clockworkgeek 2011-02-04 11:46:47

回答

6
 $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', 
    ));