Adding custom customer attributes in Magento’s default One Page Checkout is often cumbersome for developers. Most often programmers get stuck while resolving problems encountered in Magento checkout configuration, which is the most important aspect of an eCommerce website.

The Problem

Last month, one of our eCommerce clients was suffering from an unusually high shopping cart abandonment rate while checkout. While working on Magento’s default one page checkout module in Magento CE 1.8, I needed to add custom fields for customer in customer’s registration form, which is just a small step in “one page checkout”.

Though I managed to do everything accurately, the values were not getting saved in the database i.e. in the checkout register. Everything was working properly when I’m saving it either from register page or from the admin panel. But when I was trying to save customer attribute from register page of checkout then it is unable to save value.

Solution Proposed by Daffodil’s Magento Team

After a lot of search and debug I figured out that we missed an entry in table name “sales_flat_quote”.



$tablequote = $this->getTable('sales/quote');
ALTER TABLE $tablequote ADD `customer_attribute_name` varchar(100) NOT NULL"); 

The above code resolved my problem.

So the installer file should be something like this –


$installer = $this;

$setup = Mage::getModel('customer/entity_setup', 'core_setup');

$setup->addAttribute('customer', 'attribute_name', array(
'type' => 'varchar',
'input' => 'text',
'label' => 'Companycomment',
'global' => 1,
'visible' => 1,
'required' => 0,
'user_defined' => 1,
'default' => '0',
'visible_on_front' => 3,

if (version_compare(Mage::getVersion(), '1.6.0', '<='))
$customer = Mage::getModel('customer/customer');
$attrSetId = $customer->getResource()->getEntityType()->getDefaultAttributeSetId();
$setup->addAttributeToSet('customer', $attrSetId, 'General', 'attribute_name');


if (version_compare(Mage::getVersion(), '1.4.2', '>='))
->getAttribute('customer', 'attribute_name')
->setData('used_in_forms', array('adminhtml_customer','customer_account_create','customer_account_edit','checkout_register'))


$tablequote = $this->getTable('sales/quote');
ALTER TABLE $tablequote ADD `customer_attribute_name` varchar(1000) NOT NULL

Though we solved this problem for Magento CE 1.8, the above method will work on all Magento versions. Stay tuned to our blog for more such exciting stuff. Happy coding!!


2 thoughts on “Magento Checkout Problem – Custom Customer Attribute not Saved in Checkout Register”

  1. Thanks,

    This is one of the confusing issue that you have easily solved this. I use a custom checkout attributes extension by FME to add custom attributes to checkout page without facing any issue.

Leave a Reply

Your email address will not be published. Required fields are marked *

Want us to develop your Mobile/Web Solution?