How to add custom fields to Magento checkout

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

Tags: ,

6 Comments

CHMOD Octal Cheat Sheet

 

It's simple, really.

7 rwx read, write, execute
6 rw- read, write
5 r-x read, execute
4 r-- read
3 -wx write, execute
2 -w- write
1 --x execute
0 --- no permissions

 

Here are a few examples :

chmod 777 (rwxrwxrwx)
chmod 775 (rwxrwxr-x)
chmod 666 (rw-rw-rw-)

 

Further Reading

http://en.wikipedia.org/wiki/Octal
http://en.wikipedia.org/wiki/Chmod

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • Furl
  • NewsVine
  • Reddit
  • Slashdot
  • StumbleUpon
  • Technorati
  • TwitThis

Tags:

2 Comments

Magento Connect File Permissions Fix

 

 

"Error: Please check for sufficient write file permissions"

 

Uh oh, looks like something's wonky here.

 

If you are running PHP as an Apache module, Magento Connect will need full write permissions to perform upgrades, so you must apply a temporary hack while using Connect.    

 

Use an SSH client to connect to your server, navigate to the Magento directory, and enter this command :

  1. find . -type d -exec chmod 777 {} \;

 

Now, login into the Magento control panel, and use Connect to apply any needed updates and/or extensions.

 

When you are finished, you must repair the permissions :

  1. find . -type d -exec chmod 755 {} \;
  2. find . -type f -exec chmod 644 {} \;

 

Next, set write permissions on your server. Here are the recommended settings :

  1. chmod o+w var var/.htaccess app/etc
  2. chmod 550 pear
  3. chmod -R o+w media

If you run into trouble, try playing with the permissions on the "var" and "app/etc" directories (ex, "chmod 775 var var/.htaccess app/etc").   

 

Voila.

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • Furl
  • NewsVine
  • Reddit
  • Slashdot
  • StumbleUpon
  • Technorati
  • TwitThis

Tags: ,

6 Comments

Dobrodošli!

 

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • Furl
  • NewsVine
  • Reddit
  • Slashdot
  • StumbleUpon
  • Technorati
  • TwitThis
No Comments