Home / Magento / How to create custom filed for default attribute value for description and images in manage attribute options in magento

How to create custom filed for default attribute value for description and images in manage attribute options in magento

By default Magneto only provide custom options without any description, if you want to customize with description then you must change in following files:

Step 1:-

In File

app\design\adminhtml\default\default\template\catalog\product\edit\option\type\select.phtml
Find the below code:

'<th class="type-sku"><?php echo Mage::helper('catalog')->__('SKU') ?></th>'+
Add these after just after

'<th class="type-description"><?php echo Mage::helper('catalog')->__('Description') ?></th>'+
Find the below code:

'<td><input type="text" class="input-text" name="product[options][{{id}}][values][{{select_id}}][sku]" value="{{sku}}"></td>'+
Add these after just after

'<td><input type="text" class="input-text" name="product[options][{{id}}][values][{{select_id}}][description]" value="{{description}}"></td>'+
Step 2:-

In File

 app\code\core\Mage\Adminhtml\Block\Catalog\Product\Edit\Tab\Options\Option.php
Find the below code:

$value['sku'] = $this->htmlEscape($option->getSku());
Add these code just after

$value['description'] = $this->htmlEscape($option->getDescription());
Find the below code:

'sku' => $this->htmlEscape($_value->getSku()),
Add these code just after

'description' => $this->htmlEscape($_value->getDescription()),
Step 3:-

Add field in “catalog_product_option_type_value” table description.

Let me know if you have some query.

About Sushil_kumar

Check Also

How to add new search engine like Solr or Elasticsearch in Magento2

Magento 2 Community Edition comes with support for only MySQL search engine, but some projects …

Leave a Reply

Your email address will not be published. Required fields are marked *