Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Add sku # to product title in the product admin section
 
mikeinspain
Sr. Member
 
Avatar
Total Posts:  108
Joined:  2007-10-08
Alicante, Spain
 

Hey

Not sure where this question should go, if someone feels that it is better suited to a different category then please let me know.

Within the Magento admin panel.  I would like to add the product code/sku to the title.  Please the screenshot below.

http://img.skitch.com/20080818-8mrei296ir7p7refw7wc3mjyhe.preview.jpg Click for full size - Uploaded with plasq‘s Skitch

Can this be done?  This has been requested by the client and whilst I am getting more and more familiar with the whole magento setup, this is a little beyond me..  Hope someone can point me in the right direction..

 
Magento Community Magento Community
Magento Community
Magento Community
 
Anton Makarenko
Magento Team
 
Avatar
Total Posts:  184
Joined:  2008-05-13
Los Angeles, CA
 

Mage_Adminhtml_Block_Catalog_Product_Edit::getHeader()
The best way to edit (not affecting the core), is to override this method in extending class. Or if you dont care about updates - edit right there.

 
Magento Community Magento Community
Magento Community
Magento Community
 
mikeinspain
Sr. Member
 
Avatar
Total Posts:  108
Joined:  2007-10-08
Alicante, Spain
 
Anton Makarenko - 17 August 2008 11:47 PM

Mage_Adminhtml_Block_Catalog_Product_Edit::getHeader()
The best way to edit (not affecting the core), is to override this method in extending class. Or if you dont care about updates - edit right there.

Anton Thanks..

Without wanting to sound real dumb..  Don’t answer that grin

Where exactly am I looking to enable this edit?  I’m not suggesting that I will go through with mind! 
All getting slightly complicated for me here..

 
Magento Community Magento Community
Magento Community
Magento Community
 
Anton Makarenko
Magento Team
 
Avatar
Total Posts:  184
Joined:  2008-05-13
Los Angeles, CA
 

Mage_Adminhtml_Block_Catalog_Product_Edit::getHeader() means the method getHeader() of class Mage_Adminhtml_Block_Catalog_Product_Edit.
The class is located in file app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit.php - look for method getHeader() there.
In that method You will see something like this:

$header '';
        if (
$this->getProduct()->getId()) {
            $header 
$this->htmlEscape($this->getProduct()->getName());
        
}
        
else {
            $header 
Mage::helper('catalog')->__('New Product');
        
}
        
if ($setName $this->getAttributeSetName()) {
            $header
.= ' (' $setName ')';
        
}
        
return $header;
To append SKU, add following line before returning value:
$header .= $this->htmlEscape(" #{$this->getProduct()->getSku()}");
return 
$header;

Or did I misunderstood what You wanted?

 
Magento Community Magento Community
Magento Community
Magento Community
 
mikeinspain
Sr. Member
 
Avatar
Total Posts:  108
Joined:  2007-10-08
Alicante, Spain
 

Anton thanks

That’s seems exactly what I am after..  Thanks for your time.

 
Magento Community Magento Community
Magento Community
Magento Community
 
mikeinspain
Sr. Member
 
Avatar
Total Posts:  108
Joined:  2007-10-08
Alicante, Spain
 

Works like a charm..  Thanks

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top