Sam Bernard

Magento Zero Subtotal Checkout

Posted by Sam Bernard on Mon, Apr 27 2009 00:08:00

I'm building my first Magento store for a client who wanted to offer some free downloads. I enabled "Zero Subtotal Checkout" in Magento admin by going to System->Configuration->Payment Methods. Now, when a client checks out with a 0.00 subtotal, including shipping, a "No Payment Information Required" payment option appears.

However, my other payment options kept appearing as well. To combat this, I did the following

  1. Set the Sort Order for "Zero Subtotal Checkout" to 1(very important!)

  2. Edit /app/design/frontend/default/YOURTHEME/template/checkout/onepage/payment/methods.phtml

Search for a line that contains:

if( sizeof($this->getMethods()) > 1):</code>

and change it to

if( sizeof($this->getMethods()) > 1 && $_code!='free'):

Before the line containing

endforeach;

add

if($_code=='free')
 break;

Be sure to include the opening and closing php tags.