Logo
X
  • Who We Serve
    • By Role

      • CEO / Business Executives
      • CTO / IT Professionals
      • COO / Operations Head
    • By Industries

      • Healthcare
      • Digital Commerce
      • Travel and Transportation
      • Real Estate
      • Software and Technology
  • Our Technology Focus
    • Web
    • Mobile
    • Enterprise
    • Artificial Intelligence
    • Blockchain
    • DevOps
    • Internet Of Things
  • Discover Daffodil
    • About
    • Leadership
    • Corporate Social
      Responsibility
    • Partners
    • Careers
  • Resources
    • Blog

    • E-Books

    • Case Studies

    • View all resources

  • Who We Serve
    • By Role

      • CEO / Business Executives
      • CTO / IT Professionals
      • COO / Operations Head
    • By Industries

      • Healthcare
      • Digital Commerce
      • Travel and Transportation
      • Real Estate
      • Software and Technology
  • Our Technology Focus
    • Web

      Create responsive web apps that excel across all platforms

    • Mobile

      User centric mobile app development services that help you scale.

    • Enterprise

      Innovation-driven enterprise services to help you achieve more efficiency and cost savings

      • Domains
      • Artificial Intelligence
      • DevOps
      • Blockchain
      • Internet Of Things
  • Discover Daffodil
    • About
    • Leadership
    • Corporate Social Responsibilities
    • Partners
    • Careers
  • Resources
    • Blog

      Insights for building and maintaining your software projects

    • E-Books

      Our publications for the connected software ecosystem

    • Case Studies

      The impact that we have created for our clients

    • View all resources
daffodil-logo
Get in Touch
  • What We Do
    • Product Engineering

    • Discover & Frame Workshop
    • Software Development
    • Software Testing
    • Managed Cloud Services
    • Support & Maintenance
    • Smart Teams

    • Dedicated Teams
    • Offshore Development Centre
    • Enterprise Services

    • Technology Consulting
    • Robotic Process Automation
    • Legacy Modernization
    • Enterprise Mobility
    • ECM Solutions
  • Who We Serve
    • By Industry

    • Healthcare
    • Software & Technology
    • Finance
    • Banking
    • Real Estate
    • Travel & Transportation
    • Public Sector
    • Media & Entertainment
    • By Role

    • CEO / Business executives
    • CTO / IT professionals
    • COO / Operations
  • Our Expertise
    • Mobility
    • UI/UX Design
    • Blockchain
    • DevOps
    • Artificial Intelligence
    • Data Enrichment
    • Digital Transformation
    • Internet of Things
    • Digital Commerce
    • OTT Platforms
    • eLearning Solutions
    • Salesforce
    • Business Intelligence
    • Managed IT Services
    • AWS Services
    • Application Security
    • Digital Marketing
  • Case Studies
  • Discover Daffodil
    • About us
    • Partnership
    • Career & Culture
    • Case Studies
    • Leadership
    • Resources
    • Insights Blog
    • Corporate Social Responsibility
Get in Touch
resources-bg.jpg

Software Engineering Insights

Magento Checkout Problem - Custom Customer Attribute not Saved in Checkout Register

Jun 5, 2015 3:24:55 PM

  • Tweet

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".

123

 

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

The above code resolved my problem.

So the installer file should be something like this -

 New Call-to-action

[php]<?php
$installer = $this;

$installer->startSetup();
$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', '>='))
{
Mage::getSingleton('eav/config')
->getAttribute('customer', 'attribute_name')
->setData('used_in_forms', array('adminhtml_customer','customer_account_create','customer_account_edit','checkout_register'))
->save();

}

$tablequote = $this->getTable('sales/quote');
$installer->run("
ALTER TABLE $tablequote ADD `customer_attribute_name` varchar(1000) NOT NULL
");
$installer->endSetup(); [/php]

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!!

 

Topics: Digital Commerce Open Source

Ankita Agrawal

Written by Ankita Agrawal

Ankita Agrawal is leading Magento team and providing best in class e-commerce products and aimed at client satisfaction. She is very good at innovating and implementing latest marketplace solutions. Having a great experience of providing customized and featured products, she fits best for handling higher complexity projects.

Previous Post

previous_post_featured_image

Drupal 8 Responsive Design: The 'Mobilegeddon' Survival Kit

Next Post

next_post_featured_image

Creating Download Link to Direct File in Magento

Stay Ahead of the Curve with Our Weekly Tech Insights

  • Recent
  • Popular
  • Categories

Lists by Topic

  • Software Development (174)
  • Artificial Intelligence (169)
  • Mobile App Development (166)
  • Healthcare (137)
  • DevOps (80)
  • Digital Commerce (60)
  • Web Development (57)
  • CloudOps (54)
  • Digital Transformation (37)
  • Fintech (36)
  • UI/UX (29)
  • On - Demand Apps (26)
  • Software Architecture (26)
  • Internet of Things (IoT) (25)
  • Open Source (25)
  • Outsourcing (24)
  • Blockchain (21)
  • Newsroom (21)
  • Salesforce (21)
  • Technology (18)
  • Software Testing (16)
  • StartUps (16)
  • Customer Experience (14)
  • Robotic Process Automation (13)
  • Voice User Interface (13)
  • Javascript (11)
  • OTT Apps (11)
  • Business Intelligence (10)
  • Data Enrichment (10)
  • Infographic (10)
  • Big Data (9)
  • Education (9)
  • Microsoft (6)
  • Real Estate (5)
  • Banking (4)
  • Game Development (4)
  • Enterprise Mobility (3)
  • Hospitality (3)
  • eLearning (2)
  • Public Sector (1)
see all

Posts by Topic

  • Software Development (174)
  • Artificial Intelligence (169)
  • Mobile App Development (166)
  • Healthcare (137)
  • DevOps (80)
  • Digital Commerce (60)
  • Web Development (57)
  • CloudOps (54)
  • Digital Transformation (37)
  • Fintech (36)
  • UI/UX (29)
  • On - Demand Apps (26)
  • Software Architecture (26)
  • Internet of Things (IoT) (25)
  • Open Source (25)
  • Outsourcing (24)
  • Blockchain (21)
  • Newsroom (21)
  • Salesforce (21)
  • Technology (18)
  • Software Testing (16)
  • StartUps (16)
  • Customer Experience (14)
  • Robotic Process Automation (13)
  • Voice User Interface (13)
  • Javascript (11)
  • OTT Apps (11)
  • Business Intelligence (10)
  • Data Enrichment (10)
  • Infographic (10)
  • Big Data (9)
  • Education (9)
  • Microsoft (6)
  • Real Estate (5)
  • Banking (4)
  • Game Development (4)
  • Enterprise Mobility (3)
  • Hospitality (3)
  • eLearning (2)
  • Public Sector (1)
see all topics

Elevate Your Software Project, Let's Talk Now

Awards & Accolades

dj
dj
dj
dj
dj
Aws-certification-logo
microsoft-partner-2-1
microsoft-partner
google-cloud-partne
e-UI-Path-Partner-logo
partner-salesforce-reg-consulting-partner-1-1
daffodil-logo
info@daffodilsw.com
  • Home
  • About Daffodil
  • Locations
  • Privacy Policy
  • Careers

© 2025 Daffodil Unthinkable Software Corp. All Rights Reserved.

[fa icon="chevron-up"]