I would like to add the SKU to the product name in "edit product" at the admin-side. Is this possible?
1 Answer
It is possible.
Just copy Edit.php
file from Mage/Adminhtml/Block/Catalog/Product
and paste into local/Mage/Adminhtml/Block/Catalog/Product
and find following function public function getHeader()
and replace with this:
public function getHeader()
{
$header = '';
if ($this->getProduct()->getId()) {
$header = $this->escapeHtml($this->getProduct()->getSku() . " " .$this->getProduct()->getName());
}
else {
$header = Mage::helper('catalog')->__('New Product');
}
if ($setName = $this->getAttributeSetName()) {
$header.= ' (' . $setName . ')';
}
return $header;
}
See the line: $header = $this->escapeHtml($this->getProduct()->getSku() . " " .$this->getProduct()->getName());
where I have added $this->getProduct()->getSku()
. This is giving you the sku of the product.
For best practise you should follow this link. Remember this only helps you on magento core file override
. This will make sure the upgrade will not have much affect on your site.
Hope this helps.