Magento Forum

Custom Customer Attribute Not Saving in Onepage Checkout
 
josh48202
Jr. Member
 
Total Posts:  26
Joined:  2010-02-02
 

I created an observer that added customer attributes and it works during the normal customer registration but doesnt save during the onepage checkout registration.

here is my installer script with my two attributes.

<?php
$installer 
$this;
$installer->startSetup();


$installer->addAttribute("customer""customerno",  array(
    
"type"     => "varchar",
    
"backend"  => "",
    
"label"    => "Customer No.",
    
"input"    => "text",
    
"source"   => "",
    
"visible"  => true,
    
"required" => false,
    
"default" => "",
    
"frontend" => "",
    
"unique"     => false,
    
"note"       => ""

    
));

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

        
$used_in_forms=array();

$used_in_forms[]="adminhtml_customer";
$used_in_forms[]="checkout_register";
$used_in_forms[]="customer_account_create";
$used_in_forms[]="customer_account_edit";
$used_in_forms[]="adminhtml_checkout";
        
$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"0)
        ->
setData("sort_order"100)
        ;
        
$attribute->save();
    
    
    

$installer->addAttribute("customer""inmas",  array(
    
"type"     => "int",
    
"backend"  => "",
    
"label"    => "In Mas",
    
"input"    => "select",
    
"source"   => "eav/entity_attribute_source_boolean",
    
"visible"  => true,
    
"required" => false,
    
"is_user_defined" => "0",
    
"default" => "0",
    
"frontend" => "",
    
"unique"     => false,
    
"note"       => ""

    
));

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

        
$used_in_forms=array();

$used_in_forms[]="adminhtml_customer";
$used_in_forms[]="checkout_register";
$used_in_forms[]="customer_account_create";
$used_in_forms[]="customer_account_edit";
$used_in_forms[]="adminhtml_checkout";
        
$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"0)
        ->
setData("sort_order"100)
        ;
        
$attribute->save();
    
    
    
$installer->endSetup();

Like i said everything works great during the regular registration/create account page but not on the onepage checkout page.

Does anyone have any idea or have had this issue before? I would greatly appreciate any help.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Jeremie B
Jr. Member
 
Avatar
Total Posts:  11
Joined:  2010-06-02
 

Hello josh48202,

I have exactly the same problem… did you solve it since your question ?

Thanks !

 
Magento Community Magento Community
Magento Community
Magento Community
 
josh48202
Jr. Member
 
Total Posts:  26
Joined:  2010-02-02
 

No im sorry i was not able to resolve this issue. I didnt end up using the custom attribute.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top