【发布时间】:2014-01-28 10:46:31
【问题描述】:
谁能帮我在销售发票网格中加入发票项目(或订购项目)?
我想从发票中获取 sku。
$collection = Mage::getResourceModel($this->_getCollectionClass())
->addAttributeToSelect('tax_amount')
->addAttributeToSelect('increment_id')
->addAttributeToSelect('created_at')
->addAttributeToSelect('entity_id')
->addAttributeToSelect('grand_total')
->addAttributeToSelect('shipping_amount')
->addAttributeToSelect('subtotal')
->addAttributeToSelect('state')
->join('order', 'main_table.order_id=order.entity_id', array('shipping_address_id','shipping_method'))
->join('order_address', 'order.billing_address_id=order_address.entity_id', array('billing_firstname'=>'firstname','billing_lastname'=>'lastname','email','region','postcode','street','city','telephone','company','pfpj_cui','pfpj_reg_com','pfpj_banca','pfpj_iban'))
->join('shipment_track', 'main_table.order_id=shipment_track.order_id', 'track_number')
这是我尝试过的,但它不起作用......
->join('invoice_item', 'main_table.entity_id=invoice_item.parent_id', 'sku');
谢谢!
【问题讨论】: