0

Earlier add a new custom attribute biography_desc was added for customer:

$installer = $this;
$installer->startSetup();

$installer->addAttribute("customer", "biography_desc", array(
    "type" => "text",
    "backend" => "",
    "label" => "Biography",
    "input" => "textarea",
    "source" => "",
    "visible" => true,
    "required" => false,
    "default" => "",
    "frontend" => "",
    "unique" => false,
    "note" => ""

));

$attribute = Mage::getSingleton("eav/config")->getAttribute("customer", "biography_desc");


$used_in_forms = array();

$used_in_forms[] = "adminhtml_customer";
$used_in_forms[] = "customer_account_edit";
$attribute->setData("used_in_forms", $used_in_forms)
    ->setData("is_used_for_customer_segment", true)
    ->setData("is_system", 0)
    ->setData("is_user_defined", 1)
    ->setData("is_visible", 1)
    ->setData("sort_order", 100);
$attribute->save();

Now, i had to make it store dependent, so that i could add description on differnet languages: en, fr и etc.

For products this is not a problem, because table eav_entity_text has a field store_id. And all examples where it requires to do such things work on products.

Please advice how to solve this problem,now i can see only one solution json or create attributes biography_desc_en, biography_desc_fr etc.

1 Answer 1

1

You can extend Mage_Customer so that it does the same as Mage_Catalog and you can have store specific attributes.

Beside this you are right. Either create one attribute per store view or find a way to put it all in one.

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.