daily pastebin goal
52%
SHARE
TWEET

Untitled

a guest Jan 24th, 2019 64 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top