1

ステータスが実行されるように製品名のフィルタリングを実行したい(製品[Samsung、alien]これらの値はデータベースからランダムに表示されます。コードがどこに記述され、どのロジックでレンダリングされているかわかりません)。段階的に答えを提供してください。

前もって感謝します。

4

2 に答える 2

1

ソリューションを受け取りました。データベースフィールド名を使用してインデックスデータを追加しました(location:/var/www/magento/app/code/local/One/First/Block/Adminhtml/First/Grid.p‌​‌​hp)
----------->
$this->addColumn('select_first',array( 'header' => Mage::helper('first')->__('Product Name'), 'width' => '150px', 'index' => 'proid', 'type' => 'options', 'options' => Mage::getSingleton('first/arrayf')->getProArray(), ));

于 2012-12-03T08:04:10.277 に答える
0
 $collection = Mage::getModel('catalog/product')->getCollection()
        ->addAttributeToSelect('sku')
        ->addAttributeToSelect('name')
        ->addAttributeToSelect('attribute_set_id')
        ->addAttributeToSelect('type_id')
        ->joinField('qty',
            'cataloginventory/stock_item',
            'qty',
            'product_id=entity_id',
            '{{table}}.stock_id=1',
            'left')
        ->joinAttribute('status', 'catalog_product/status',
                        'entity_id', null, 'inner', $store->getId());

これで、$ collectionにすべての製品とそれぞれのステータスが表示されたので、次の方法でフィルターを実行できます。

$collection->addAttributeToFilter('status', array(
'like' => array('status'),
));
于 2012-10-08T12:08:20.073 に答える