Magento Shipping Method Modifications

After making various conversion rate tweaks on the standard shipping method configurations I thought i’d put it all together in a post for others to use.

The Goals are:

  • If free shipping is an available option don’t show any other options
  • Auto select the available option – to remove an unnecessary click

(Please note in this example I’m using the IG_FlatShipping5 extension – but it works on the standard install too)

Find your available.phtml file in: app/design/frontend/default/default/template/checkout/onepage/shipping_method/or if using the IG_FlatShipping5 extension in: app/design/frontend/default/default/template/ig_flatshipping5

These are the code snippets to add:

 

Auto Select mod

getCode()=='freeshipping_freeshipping' && !$this->getAddress()->getShippingMethod()) {
$this->getAddress()->setShippingMethod($_rate->getCode());
} ?>

getCode()=='flatrate_flatrate' && !$this->getAddress()->getShippingMethod()) {
$this->getAddress()->setShippingMethod($_rate->getCode());
} ?>

getCode()=='flatrate2_flatrate2' && !$this->getAddress()->getShippingMethod()) {
$this->getAddress()->setShippingMethod($_rate->getCode());
} ?>

getCode()=='flatrate3_flatrate3' && !$this->getAddress()->getShippingMethod()) {
$this->getAddress()->setShippingMethod($_rate->getCode());
} ?>

getCode()=='flatrate4_flatrate4' && !$this->getAddress()->getShippingMethod()) {
$this->getAddress()->setShippingMethod($_rate->getCode());
} ?>

getCode()=='flatrate5_flatrate5' && !$this->getAddress()->getShippingMethod()) {
$this->getAddress()->setShippingMethod($_rate->getCode());
} ?>

Obviously if you only using a couple of the flatrates delete the unnecessary ones. Here is the finished patched file:

getShippingRates())): ?>
__('Sorry, no quotes are available for this order at this time.') ?>

$_rates): ?>
getCarrierName($code) ?>
    Auto Select mod getCode()=='freeshipping_freeshipping' && !$this->getAddress()->getShippingMethod()) { $this->getAddress()->setShippingMethod($_rate->getCode()); } ?> getCode()=='flatrate_flatrate' && !$this->getAddress()->getShippingMethod()) { $this->getAddress()->setShippingMethod($_rate->getCode()); } ?> getCode()=='flatrate2_flatrate2' && !$this->getAddress()->getShippingMethod()) { $this->getAddress()->setShippingMethod($_rate->getCode()); } ?> getCode()=='flatrate3_flatrate3' && !$this->getAddress()->getShippingMethod()) { $this->getAddress()->setShippingMethod($_rate->getCode()); } ?> getCode()=='flatrate4_flatrate4' && !$this->getAddress()->getShippingMethod()) { $this->getAddress()->setShippingMethod($_rate->getCode()); } ?> getCode()=='flatrate5_flatrate5' && !$this->getAddress()->getShippingMethod()) { $this->getAddress()->setShippingMethod($_rate->getCode()); } ?>
  • getErrorMessage()): ?>
      • getErrorMessage() ?>
    getCode()===$this->getAddressShippingMethod()) echo ' checked="checked"' ?>/>
getInfoText($code)) { ?>

So as an overview, the above modification when using the flat rate 5 extension with free shipping enabled will auto select the options and if free shipping is activated it will remove the unnecessary options.

2 comments
  1. Perfect solution! This is exactly what I was looking for!
    Thank you, thank you thank you for your post!

Leave a Reply

Your email address will not be published. Required fields are marked *

Previous Post

Magento – How to move layered navigation to the top of the sidebar

Next Post

Magento Dashboard Graphs not Showing

Related Posts