
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












#1 by Ionut at June 1st, 2009
| Quote
Hello,
I have added additional fields into mysql4-install-0.0.3.php. But how can I run the file (not working when called in URL).
Regards,
Ionut
#2 by admin at June 2nd, 2009
| Quote
Hey lonut,
You will need to run the file via SSH ->
mysql -u [username] -p [database] < mysql4-install-0.0.3.phpReally the best way to do this would be to create a new extension, add multiple field functionality to this comment plugin, and release it to the community…. Maybe if I get some time I’ll put that together….
#3 by Roland at October 29th, 2009
| Quote
I did use this script via ssh but it returns an error.
Error :
ERROR 1064 (42000) at line 1: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘<?php
$installer = $this’ at line 1
#4 by Roland at November 12th, 2009
| Quote
I tried this one mysql -u [username] -p [database] < mysql4-install-0.0.3.php via ssh but it didn’t work.
I’m eager to make comment box function in the checkout page. Can you help me out please…..
#5 by admin at December 17th, 2009
| Quote
hey roland, yeah, there’s actually a lot that goes into modifying this plugin. i believe i may have over-simplified the approach in my post here. for a quick solution, check out this plugin by AITOC ->
http://www.aitoc.com/en/magentomods_checkoutfieldsmanager.html
it’s a sweet extension, and the AITOC guys offer great support. worth the money for sure…
#6 by roy simkes at June 9th, 2010
| Quote
you don’t need to run the mysql4 script via command line.
Open your core_resource table and in there, delete the line with biebersdorf_customerordercomment (or something like that). When you run your site again, the mysql script will run too. For this to happen for your module, you should add setup related configuration your config.xml file.