Guest User

Untitled

a guest
Jan 24th, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. protected function _prepareCollection()
  2. {
  3. $collection = Mage::getResourceModel('test_testing/order_collection');
  4. $collection->setProductFilter($this->_product->getId())->setParentItemIdFilter();
  5. $coreResource = Mage::getSingleton('core/resource');
  6. $collection->getSelect()
  7. ->joinLeft(array('billing_address' => $coreResource->getTableName('sales_flat_order_address')),
  8. '`sales_order`.`billing_address_id` = `billing_address`.`entity_id`',
  9. array('customer_firstname' => 'billing_address.firstname',
  10. 'customer_lastname' => 'billing_address.lastname',
  11. 'customer_email' => 'billing_address.email',
  12. ));
  13.  
  14. $collection->getSelect()->limit(2);
  15. $this->setCollection($collection);
  16. return parent::_prepareCollection();
  17. }
Add Comment
Please, Sign In to add comment