I want to change the default SKU attribute (product number) inside the orderview, at the items block, to a custom attribute.
See:
Currently by default the SKU is displayed, I want to change this into the DPN (my custom created attribute).
The attribute code for this is: dpn.
How can I achieve that?
I edit the file:
/app/code/core/Mage/Adminhtml/Block/Sales/Items/Column/Default.php
From default code:
public function getSku()
{
/*if ($this->getItem()->getProductType() == Mage_Catalog_Model_Product_Type::TYPE_CONFIGURABLE) {
return $this->getItem()->getProductOptionByCode('simple_sku');
}*/
return $this->getItem()->getSku();
}
To:
public function getSku()
{
/*if ($this->getItem()->getProductType() == Mage_Catalog_Model_Product_Type::TYPE_CONFIGURABLE) {
return $this->getItem()->getProductOptionByCode('simple_sku');
}*/
return $this->getItem()->getDpn();
}
But that does not work. When I change the value to return $this->getItem()->getProductId();
Then I get the Product Id, so that does work.
How can I get the data from the attribute?