I would like to Add selected attribute values to product title while adding/editing a product in admin.

eg. Product Name entered: Laptop

Attributes Selected 1) Brand - Toshiba 2) Colour- White 3) other attribute value

When a product added/edited from admin, the above selected attribute value concatenate to the title and then save in database.

Final Output: Product Name: Toshiba Laptop White (attribute sequence doesn't matter)

While writing this question: other issue, while editing product the attribute values saved in database will be shown in product name field. So while submitting the revised item, ideally it should check if product name contains attribute value if so ignore attribute values.

Basically, I want product name based on selected attributes values of a certain product.

By this, custom attributes are not required to manually add on places like catalog list/view, cart, invoices, pdf, email, customer account, breadcrumb, and other relative places.

[The other solution would be manually echo of attribute values on required locations (invoices, pdf, email, catalog and so on) which means editing lots of files which in opinion would be cumbersome!]

I am open to paid extension/work or customise code which could resolve this issue.

Please anyone who could help ?

Thank you


3 Answers 3


I have Create An Module For This Purpose. It May be help full for you.


<?xml version="1.0"?>


<?xml version="1.0"?>
                          <Designo_Productname before="Mage_Adminhtml">Designo_Productname_Adminhtml</Designo_Productname>


 class Designo_Productname_Helper_Data extends Mage_Core_Helper_Abstract


 require_once 'Mage/Adminhtml/controllers/Catalog/ProductController.php';
 class Designo_Productname_Adminhtml_Catalog_ProductController extends Mage_Adminhtml_Catalog_ProductController

 public function editAction()
    $productId  = (int) $this->getRequest()->getParam('id');
    $product = $this->_initProduct();
    $productName = $product->getData('name');
    $productColor = $product->getAttributeText('color');
    $productBrand = $product->getAttributeText('computer_manufacturers');
    $ProductCompleteName = $productName.' '.$productBrand.' '.$productColor;

    if ($productId && !$product->getId()) {
        $this->_getSession()->addError(Mage::helper('catalog')->__('This product no longer exists.'));


    Mage::dispatchEvent('catalog_product_edit_action', array('product' => $product));

    $_additionalLayoutPart = '';
    if ($product->getTypeId() == Mage_Catalog_Model_Product_Type::TYPE_CONFIGURABLE
        && !($product->getTypeInstance()->getUsedProductAttributeIds()))
        $_additionalLayoutPart = '_new';

        'adminhtml_catalog_product_'.$product->getTypeId() . $_additionalLayoutPart


    if (!Mage::app()->isSingleStoreMode() && ($switchBlock = $this->getLayout()->getBlock('store_switcher'))) {
        $switchBlock->setDefaultStoreName($this->__('Default Values'))
                $this->getUrl('*/*/*', array('_current'=>true, 'active_tab'=>null, 'tab' => null, 'store'=>null))


    $block = $this->getLayout()->getBlock('catalog.wysiwyg.js');
    if ($block) {

 * Save product action
public function saveAction()
    $storeId        = $this->getRequest()->getParam('store');
    $redirectBack   = $this->getRequest()->getParam('back', false);
    $productId      = $this->getRequest()->getParam('id');
    $isEdit         = (int)($this->getRequest()->getParam('id') != null);

    $data = $this->getRequest()->getPost();
    $data['name'] = Mage::registry('previous_name');
    if ($data) {

        $product = $this->_initProductSave();

        try {
            $productId = $product->getId();

             * Do copying data to stores
            if (isset($data['copy_to_stores'])) {
                foreach ($data['copy_to_stores'] as $storeTo=>$storeFrom) {
                    $newProduct = Mage::getModel('catalog/product')

            $this->_getSession()->addSuccess($this->__('The product has been saved.'));
        } catch (Mage_Core_Exception $e) {
            $redirectBack = true;
        } catch (Exception $e) {
            $redirectBack = true;

    if ($redirectBack) {
        $this->_redirect('*/*/edit', array(
            'id'    => $productId,
    } elseif($this->getRequest()->getParam('popup')) {
        $this->_redirect('*/*/created', array(
            '_current'   => true,
            'id'         => $productId,
            'edit'       => $isEdit
    } else {
        $this->_redirect('*/*/', array('store'=>$storeId));


Before Install this Module Create Backup of your site and Database. After Install this Module Flush All Cache.

It May be helpfull for you.

  • thanks for the post, I will try this. May I know what are the functionalities this module covers?
    – harry
    Commented Oct 29, 2014 at 7:13
  • this is not working properly
    – harry
    Commented Oct 29, 2014 at 10:32

Take a look Recreating URL keys

class MageStack_24869_Model_Observer{
  public function updateurl($observer){
    //Mage::log('My log entry', null, 'mylogfile.log');
    $_product = $observer->getEvent()->getProduct()
        $name = '';
        $brand = $_product->getAttributeText('manufacturer')
        if(strpos($_product->getData('name'), 'Brand') === false)){
           $name =. $_product->getData('name') . ' ' . $brand;


        $Product->setData('name', rtrim($name, '-');      

You may want to create a new attribute to store the original product title to avoid do a lot of string manipulation

See Customizing magento using event observer method

  • thanks for the response. I didn't thought about url key, now I know they also need to be updated. Looking at this and recreating URL keys post they all are updating url keys. I wonder how would I update product name as well? I am not a magento expert, this is the first time I am working with magento. It would be much helpful if you could explain a little bit more!? thanks
    – harry
    Commented Oct 29, 2014 at 3:17
  • Every time a product is save in magento it will trigger catalog_product_save_before event which can be catch using an observer. Therefore in your update product attribute before it is save ... read more Commented Oct 29, 2014 at 3:22
  • above url not working
    – harry
    Commented Oct 29, 2014 at 3:35
  • Just add the link to my answer ( Customizing magento using event observer method) Commented Oct 29, 2014 at 3:43
  • hi RS, The above method is bit complicated, when every time a product gets edited, it has to check if attribute value already added in title. Further, if we change attribute value it should first delete previous value added in product name then add new one. So, I would like to know what is the best way to add custom attribute appear along with product name on cart, invoices, pdf, almost every where. Any suggestions? Thank you
    – harry
    Commented Oct 30, 2014 at 18:16

If your only wish is to add the attributes to the title, why not changing the page/html/head.phtml or implement an observer which changes the title: \Mage_Page_Block_Html_Head::setTitle

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.