0
商品「sellable_in_market」のカスタム属性を作成しました。それを製品グリッドに表示しようとしました。しかし、その列は空です。しかし、私がYES/NOでフィルタリングすると、それが表示されます。どのようにグリッド内のフィルタを使用して属性値( "sellable_in_market")を表示するか?何をすべきかわからない。以下は私のコードです。カタログ製品グリッドのカスタム属性値をマゼンタで表示するにはどうすればよいですか?
アドバンスありがとうございました。
protected function _prepareCollection()
{
parent::_prepareCollection();
$collection = $this->getCollection();
$store = $this->_getStore();
if ($store->getId()) {
$collection = $collection->joinAttribute(
'sellable_in_market',
'catalog_product/sellable_in_market',
'entity_id',
null,
'left',
$store->getId()
);
}
else {
$collection = $collection->joinAttribute('sellable_in_market', 'catalog_product/sellable_in_market', 'entity_id', null, 'left');
}
$this->setCollection($collection);
return $this;
}
protected function _prepareColumns()
{
$this->addColumnAfter('sellable_in_market',
array(
'header'=> Mage::helper('catalog')->__('Resellable'),
'width' => '60px',
'index' => 'sellable_in_market',
'sortable' => true,
'type' => 'options',
'options' => array("1" => 'Yes', "0" => 'No'),
),
'type'
);
parent::_prepareColumns();
}
「再販売可能」の列は空です。しかし、yes/noでフィルタすると表示されます。 デフォルトでグリッドにカスタム値を表示する方法はありますか?
商品の一覧ページに商品の配列を印刷しましたか? –
はい、そこには問題ありません。私はそこに "sellable_in_market"を見ることができます。 –
管理グリッドであなたのコレクションの価値を得ていますか? –