//To get the subtotal in shipping method (onepage checkout)
$subtotal = Mage::getSingleton(‘checkout/session’)->getQuote()->getSubtotal()
If cart total is less than 500 flat rate will enabled and free shipping will be disabled , for this
app/design/frontend/Your-Namespace /MODULE/template/checkout/onepage/shipping_method/available.phtml
<?php
if($subtotal >=500)
{
// Remove any other shipping methods if free shipping is available
if (array_key_exists(‘freeshipping’, $_shippingRateGroups )) {
$_shippingRateGroups = array(‘freeshipping’ => $_shippingRateGroups[‘freeshipping’]);
}
}
if($subtotal >=500)
{
// Remove any other shipping methods if free shipping is available
if (array_key_exists(‘freeshipping’, $_shippingRateGroups )) {
$_shippingRateGroups = array(‘freeshipping’ => $_shippingRateGroups[‘freeshipping’]);
}
}
?>
(Visited 83 times, 1 visits today)