Join tables to get sold products

Posted by latvian on Stack Overflow See other posts from Stack Overflow or by latvian
Published on 2010-04-06T02:18:56Z Indexed on 2010/04/06 2:23 UTC
Read the original article Hit count: 289

Filed under:

Hi,

I am joining two tables 'sales/order_item_collection' and 'sales/orders' by 'order_id', so that afterward i can filter sold products by 'store_id' and 'product_name'

Here is the code: $orderTable = Mage::getSingleton('core/resource')->getTableName('sales/order'); $itemsCollection= Mage::getResourceModel('sales/order_item_collection') ->join(array('ord'=>$orderTable),'e.order_id = ord.entity_id');

Why is this join not working?

Thank you

© Stack Overflow or respective owner

Related posts about magento