Magento 1.9 – Autoselect Cheapest UPS Shipping Rate at Checkout

checkoutmagento-1.9shippingups

I need to auto select the cheapest UPS shipping rate on checkout page.

enter image description here

in the picture above I need Ground to be selected by default.

we are trying to make our checkout easier for customers and pre-selecting shipping rate is the first step.

PS: I tried modifying

app/design/frontend/base/default/template/checkout/onepage/shipping_method/available.phtml

and had checked="checked" placed for the first item and it worked. But grandtotal didn't include shipping cost in that case.

Best Answer

You can fire a JS click method after page load like

<script type="text/javascript">
//<![CDATA[
jQuery(function($) {
    $('input[name="shipping_method"]').get(0).click;
});
//]]>

You can use the same thing on specific element id of Ground

Related Topic