Question

I have a custom setup script in a module like this

<?php

$installer = new Mage_Catalog_Model_Resource_Setup('core_setup');
$installer->startSetup();

$attributeSetDefault = 'Default';
$attributeGroup = 'test';
$attributeSetId = $installer->getAttributeSetId('catalog_product', $attributeSetDefault);
if ($attributeSetId) {
    $attributeGroupId = $installer->getAttributeGroupId('catalog_product', $attributeSetId, $attributeGroup);
}

// Attribut : Barcode EAN13
$attributCode = 'barcode_ean13';
$installer->removeAttribute('catalog_product', $attributCode);
$attribute = $installer->getAttribute('catalog_product', $attributCode);
if (empty($attribute['attribute_id'])) {

    $installer->addAttribute(Mage_Catalog_Model_Product::ENTITY, $attributCode, array(
        'type' => 'varchar',
        'input' => 'text',
        'backend' => '',
        'input_renderer' => 'test_catalog/adminhtml_product_helper_form_barcodeean13', //definition of renderer
        'label' => 'Barcode EAN13',
        'class' => '',
        'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
        'visible' => true,
        'required' => false,
        'user_defined' => true,
        'searchable' => false,
        'filterable' => false,
        'comparable' => false,
        'visible_on_front' => false,
        'unique' => false,
        'apply_to' => 'simple',
        'configurable' => false,
    ));

    $attributeId = $installer->getAttributeId('catalog_product', $attributCode);

    if ($attributeGroupId && $attributeId) {
        $installer->addAttributeToGroup('catalog_product', $attributeSetId, $attributeGroupId, $attributeId);
    }
}
$installer->endSetup();

My questions are:

  1. How 'input_renderer' => 'test_catalog/adminhtml_product_helper_form_barcodeean13', //definition of renderer added in database? Where can i find this in database?

  2. How to change the value of input_renderer? (the setup script was already ran)

Was it helpful?

Solution

The input renderer is found within the catalog_eav_attribute table.

You can update it using the following SQL:

    UPDATE catalog_eav_attribute 
        SET frontend_input_renderer = 'New Input Renderer' 
        WHERE frontend_input_renderer = 'test_catalog/adminhtml_product_helper_form_barcodeean13';
Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top