Получение способа оплаты в отчет в Magento - PullRequest
0 голосов
/ 14 декабря 2011

Я использую модуль челнока (Unirgy_Dropship_Block_Adminhtml_Report_Grid) и пытаюсь добавить способ оплаты в качестве столбца.Я смог найти нужную таблицу и добавить ее в коллекцию.Проблема в том, что поля заполнены нулями.Любая идея?Это мой основной код: строка, которую нужно исправить, это строка joinLeft, в которую я добавляю атрибут method.

protected function _prepareCollection() {
    //...
    $eav = Mage::getSingleton('eav/config');
    $oapAttr = $eav->getAttribute('order_payment', 'method');
    $collection = Mage::getResourceModel('sales/order_shipment_collection');
    //...
    $collection->getSelect()
        ->join(array('oa'=>Mage::getSingleton('core/resource')->getTableName('sales_order_entity')), 'oa.parent_id=_table_order_increment_id.entity_id', array())
        ->joinLeft(array('oap'=>Mage::getSingleton('core/resource')->getTableName('sales_order_entity_varchar')), "oap.entity_id=oa.entity_id and oap.attribute_id=".$oapAttr->getId(), array('method'=>'value'))
    ;
    $this->setCollection($collection);
    //...
    return parent::_prepareCollection();
}
protected function _prepareColumns() {
    //...
    $this->addColumn('method', array(
        'header'  => $hlp->__('Payment Method'),
        'index'   => 'method',
        'type'    => 'options',
        'options' => array(
            'authorizenet'    => "Credit Card",
            'paypal_standard' => "Paypal",
            'ugiftcert'       => "Gift Certificate",
            'free'            => "Free",
        )
    ));
    //...
}

1 Ответ

0 голосов
/ 22 декабря 2011

Второй пост по этой ссылке мне очень помог, когда я сделал что-то подобное

http://www.magentocommerce.com/boards/viewthread/192232/

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...