1

This is my code:

$attributeCode = 'customer_custom_field';
$attributeData = array(
    'label'         => 'Customer Custom Field',
    'input'         => 'text',
    'type'          => 'text',
    'global'        => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
    'visible'       => 1,
    'required'      => 0,
    'user_defined'  => 1,
    'backend'            => 'mynamespace_mymodule/attribute',
    'input_renderer'     => 'mynamespace_mymodule/customer_attribute'
);

and in the mynamespace/mymodule/Block/Customer/Attribute.php file I have:

class Mynamespace_Mymodule_Block_Customer_Attribute extends Varien_Data_Form_Element_Text
{
    public function getAfterElementHtml()
    {
        echo 1; exit();
        $html = parent::getAfterElementHtml();
        return $html."  <script>
                        $('".$this->getHtmlId()."').disable();
                        </script>";
    }

}

I never get the echo 1; exit (). Why ? The "input_renderer" is not available for customer attributes ? thx

[UPDATE]

<?xml version="1.0"?>
<config>
    <modules>
        <Mynamespace_Mymodule>
            <version>0.10.0</version>
        </Mynamespace_Mymodule>
    </modules>
    <global>
        <blocks>
            <mynamespace_mymodule>
                <class>Mynamespace_Mymodule_Block</class>
            </mynamespace_mymodule>
        </blocks>
        <helpers>
            <mynamespace_mymodule>
                <class>Mynamespace_Mymodule_Helper</class>
            </mynamespace_mymodule>
        </helpers>
        <models>
            <mynamespace_mymodule>
                <class>Mynamespace_Mymodule_Model</class>
            </mynamespace_mymodule>
        </models>
    </global>
</config>
  • please share config.xml cod of your module – Amit Bera Jul 27 '16 at 10:27
  • should I had to include smth specific , customer attribute related there in the config.xml ? Cuz I didn't – Attila Naghi Jul 27 '16 at 10:33
  • please share code of mynamespace/mymodule/etc/config.xml – Amit Bera Jul 27 '16 at 10:41
  • @AmitBera I updated my post , please check it – Attila Naghi Jul 27 '16 at 10:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.