Posts Tagged ‘shipping methods’

If you offer Free Shipping to your customers, then you may have noticed that the default Shipping Methods are still displayed when the Free Shipping Method activates. This can be confusing for the shopper and they need another click to select the “Free Shipping” over the existing rates.

The following code will hide the other shipping methods from the shopping cart page, the default magento checkout and one page checkout.

The file you need to adjust is: app/ design/ frontend/ default/ YOURTEMPLATE/ template/ checkout/ onepage/ shipping_method/ available.phtml

Place the following code right before the <dl> tag that displays the different options.

<?php
if ( array_key_exists('freeshipping', $_shippingRateGroups )) {
$_shippingRateGroups = array('freeshipping' => $_shippingRateGroups['freeshipping']);
}
?>

You can even just unset specific Shipping Methods such as the “Flat Rate Method” using:

<?php
if ( array_key_exists('freeshipping', $_shippingRateGroups )) {
unset($_shippingRateGroups["flatrate"]);
}
?>