I have tried to save a custom field value during checkout registration in customer registration its worked fine i have referred many question in stack exchange based on this problem and nothing work for me . here i'm try to save mobile numbers of customer during their registration (no issue occurred during normal user registration)

Here is my config.xml

<?xml version="1.0"?>

and the mysql query to run

$installer = $this;

$installer->addAttribute("customer", "mobile_reg",  array(
    "type"     => "varchar",
    "backend"  => "",
    "label"    => "Mobile Number",
    "input"    => "text",
    "source"   => "",
    "visible"  => true,
    "required" => true,
    "default" => "",
    "frontend" => "",
    "unique"     => false,
    "note"       => ""


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


        $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)
$tablequote = $this->getTable('sales/quote');
ALTER TABLE $tablequote ADD `customer_mobile_reg` varchar(1000) NOT NULL


here is my billing.phtml

<div class="field">
                <label for="billing:mobile_reg" class="required"><em>*</em><?php echo $this->__('Mobile Number') ?></label>
              <div class="input-box">

            <input type="text" name="billing[mobile_reg]" value="<?php echo $this->escapeHtml($this->getAddress()->getmobile_reg()) ?>" title="<?php echo $this->quoteEscape($this->__('Mobile Number')) ?>" class="input-text" id="billing:mobile_reg" />

  • Your are created customer attribute not a customer address attribute and your are trying save via billing address object.so need to change some code. – Abdul May 8 '17 at 5:27
  • @ Abdul there i need to save both in customer registration and checkout registration customer registration working fine in checkout what i need to change can you help me – amith lal May 8 '17 at 5:33

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.