|
Hi.
I’m hoping you database buffs would be able to help me out here.
I’m currently using the qikDropShipper module. While it’s been an excellent solution, parts of it have been badly coded (well I think so). It’s worked fine, up until someone ordered 2 items at once.
I get the error Item (Mage_Sales_Model_Order) with the same id “78” already exist. I’ve traced it down to a join statement in the modules code folder:
$collection = Mage::getModel('sales/order')->getCollection(); $collection->getSelect() ->join(array('oi' => $helper->getTableName('sales_flat_order_item')), 'oi.order_id=main_table.entity_id', array('oi.*')) ->join(array('pei' => $helper->getTableName('catalog_product_entity_int')), 'pei.entity_id=oi.product_id', array()) ->joinNatural(array('ea' => $helper->getTableName('eav_attribute'))) ->join(array('vendors' => $helper->getTableName('vendors')), 'vendors.vendor_code=pei.value', array('vendors.company_name')) ->where('ea.attribute_code="manufacturer"') ;
Does anything stand out here that could be contributing to this error?
I looked at the sales_flat_order_item table and 78 is the only repeated ID in there.
If anyone out there could point me in the right direction, I would love you forever.
Thanks,
Tom
|