Grid.phpファイルに次のコードがあります。
function _prepareCollection () {
$collection = Mage::getResourceModel($this->_getCollectionClass());
$collection->getSelect()->joinLeft(
array('sfog' => 'sales_flat_order_grid'),
'main_table.entity_id = sfog.entity_id',
array('sfog.shipping_name','sfog.billing_name')
);
$collection->getSelect()->joinLeft(
array('sfo'=>'sales_flat_order'),
'sfo.entity_id=main_table.entity_id',
array(
'sfo.customer_email',
'sfo.weight',
'sfo.discount_description',
'sfo.increment_id',
'sfo.store_id',
'sfo.created_at',
'sfo.status',
'sfo.base_grand_total',
'sfo.grand_total'
)
);
テーブルsales_order_itemも追加したいのですが、このテーブルを追加すると、次のエラーが発生します。
同じID「119」のアイテム(Mage_Sales_Model_Order)がすでに存在します
とにかくこれの周り?