0

I need a little help ..

I need to create a new field in the registration form, and this field needs to be dynamic.

I enter the panel and add the options that I want to appear in this form, and in the registration page the user chooses one of this information.

I need 2 tables to make this query, just by business rule.

Can someone help me?

0

You have to follow this answer, then you replace the install script with this one:

<?php
$this->addAttribute('customer', 'license_number', array(
    'type'      => 'int',
    'label'     => 'License Number',
    'input'     => 'select',
    'position'  => 120,
    'required'  => false,//or true
    'is_system' => 0,
    'source'    => 'eav/entity_attribute_source_table', 
    'option'    => [
        'values'=> [
             0 => 'Information 1',
             1 => 'Information 2',
             2 => 'Information 3',
        ]
    ],
));
$attribute = Mage::getSingleton('eav/config')->getAttribute('customer', 'license_number');
$attribute->setData('used_in_forms', array(
    'adminhtml_customer',
    'checkout_register',
    'customer_account_create',
    'customer_account_edit',
));
$attribute->setData('is_user_defined', 0);
$attribute->save();

Nb: The attribute wil be stored in eav_attribute table.

  • can how i create a table with that? – Willian Sugiyama Aug 14 '17 at 20:47
  • I need to create 2 tables, like a hive of activity, and hive of activity erp.. But i don't know how to start.. – Willian Sugiyama Aug 14 '17 at 20:53
  • the solution that i gave you adds the field and attribute in eav_attribute table – PЯINCƏ Aug 14 '17 at 22:03

Your Answer

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

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