Custom Magento checkout fields

Here's a quick easy way to add fields to the checkout process.

 

1. Visit Magento Connect and install the Customer Order Comment Extension
  • Magento Connect can be accessed from the Magneto Admin panel by going to System -> Magento Connect -> Magento Connect Manager
  • If you have difficulties with Connect, check out my other post regarding Connect permissions

 

2. Update Magento template files
  • Check out the sample file templates in  /app/code/community/Biebersdorf/CustomerOrderComment/design/ and copy these files over the corresponding files in your template.    You may also use these files as a reference, and simply modify your existing template files.
  • To update the displayed text, modify this line in each of the aformentioned templates -> <?php echo $this->helper('biebersdorfcustomerordercomment')->__('How did you hear about us?') ?>
  • If you do not already have a custom template, I suggest installing the Magento Blank Theme and modifying this instead of the default Magento template

 

3. Voila!
  • Make sure your Magento cache is turned off, and test the checkout process.   You should now see the new field on the checkout confirmation page.

 

Room for improvement?

Certainly.     You can add additional fields by following these steps ->

  • Modify /app/code/community/Biebersdorf/CustomerOrderComment/design/mysql4-install-0.0.3.php and add the desired EAV-Attributes in the "sales/order" entity.
  • Run this file and it will create the attributes and corresponding database entries
  • Add the form fields in the template files
  • Modify /app/code/community/Biebersdorf/CustomerOrderComment/Helper/Data.php to grab these new fields and save them in the database
Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • Furl
  • NewsVine
  • Reddit
  • Slashdot
  • StumbleUpon
  • Technorati
  • TwitThis