Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- protected function _prepareCollection()
- {
- $collection = Mage::getResourceModel('test_testing/order_collection');
- $collection->setProductFilter($this->_product->getId())->setParentItemIdFilter();
- $coreResource = Mage::getSingleton('core/resource');
- $collection->getSelect()
- ->joinLeft(array('billing_address' => $coreResource->getTableName('sales_flat_order_address')),
- '`sales_order`.`billing_address_id` = `billing_address`.`entity_id`',
- array('customer_firstname' => 'billing_address.firstname',
- 'customer_lastname' => 'billing_address.lastname',
- 'customer_email' => 'billing_address.email',
- ));
- $collection->getSelect()->limit(2);
- $this->setCollection($collection);
- return parent::_prepareCollection();
- }
Add Comment
Please, Sign In to add comment