4

Magento 1.4.2 で管理モジュールを設計しています。製品の詳細 (製品名、SKU、価格、特別価格、数量) を表示するグリッド レイアウトを開発しています。すべての列を表示しました。特別価格を 1 つの列に表示する方法がわかりません。特別価格を取得できません。これを解決するのを手伝ってください。

このコードを使用して価格を取得しました。

$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

1 に答える 1

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',
    ));
于 2011-03-31T17:54:51.030 に答える