-
- sn1pereagle

-
Total Posts: 27
Joined: 2008-12-19
|
Hello,
I am trying to display the shipping firstname and last name in the shipping grid.
I have to to join the attribute this waÿ:
protected function _getCollectionClass() { return \'sales/order_shipment_collection\'; }
protected function _prepareCollection() { $collection = Mage::getResourceModel($this->_getCollectionClass()) ->joinAttribute(\'shipping_address_id\', \'shipment/shipping_address_id\', \'entity_id\', null, \'left\') ->joinAttribute(\'customer_email\', \'customer/email\', \'customer_id\', null, \'left\') ->joinAttribute(\'taxvat\', \'customer/taxvat\', \'customer_id\', null, \'left\') ->joinAttribute(\'prefix\', \'customer/prefix\', \'customer_id\', null, \'left\') ->joinAttribute(\'shipping_company\', \'order_address/company\', \'shipping_address_id\', null, \'left\') ->joinAttribute(\'shipping_firstname\', \'order_address/firstname\', \'shipping_address_id\', null, \'left\') ->joinAttribute(\'shipping_middlename\', \'order_address/middlename\', \'shipping_address_id\', null, \'left\') ->joinAttribute(\'shipping_lastname\', \'order_address/lastname\', \'shipping_address_id\', null, \'left\') ->joinAttribute(\'shippingStreet\', \'order_address/street\', \'shipping_address_id\', null, \'left\') ->joinAttribute(\'shipping_postcode\', \'order_address/postcode\', \'shipping_address_id\', null, \'left\') ->joinAttribute(\'shipping_city\', \'order_address/city\', \'shipping_address_id\', null, \'left\') ->joinAttribute(\'shipping_telephone\', \'order_address/telephone\', \'shipping_address_id\', null, \'left\') ->joinAttribute(\'shipping_fax\', \'order_address/fax\', \'shipping_address_id\', null, \'left\') ->joinAttribute(\'shipping_region\', \'order_address/region\', \'shipping_address_id\', null, \'left\') ->joinAttribute(\'shipping_country_code\', \'order_address/country_id\', \'shipping_address_id\', null, \'left\') ->joinAttribute(\'order_created_at\', \'order/created_at\', \'order_id\', null, \'left\') ->joinAttribute(\'order_increment_id\', \'order/increment_id\', \'order_id\', null, \'left\'); $this->setCollection($collection); return parent::_prepareCollection(); }
and in the addcolum section i have inserted this:
$this->addColumn(\'shipping_firstname\', array( \'header\' => Mage::helper(\'shipping\')->__(\'Ship to First name\'), \'index\' => \'shipping_firstname\', ));
can anybody please tell me why it doesn;t show the shipping firstname.. ?
thank you in advance.
|