title: autoselect shipping method in magento
body: <p>hey guys I have only one shipping method called JNE <a href="http://www.magentocommerce.com/magento-connect/suhanto-jne.html" rel="nofollow">http://www.magentocommerce.com/magento-connect/suhanto-jne.html</a> in my magento store </p>
  
  <p>I want to the shipping method automaticly selected when my customer fill his city.</p>
  
  <p>I already search and found this : <a href="http://www.magentocommerce.com/boards/viewthread/9223/#t33602" rel="nofollow">http://www.magentocommerce.com/boards/viewthread/9223/#t33602</a></p>
  
  <p>his solution is like this</p>
  
  <pre><code>// find methods loop:
              &lt;?php foreach ($_rates as $_rate): ?&gt;
  
  //  add checking for free shipping method and setting it as default
                  &lt;?php if ($_rate-&gt;getCode()=='freeshipping_freeshipping' &amp;&amp; !$this-&gt;getAddress()-&gt;getShippingMethod()) {
                  $this-&gt;getAddress()-&gt;setShippingMethod($_rate-&gt;getCode());
              } ?&gt;
  </code></pre>
  
  <p>I don't know where should I place my code in available.html</p>
  
  <p>by the way I have this code in my available.html</p>
  
  <hr>
  
  <pre><code>&lt;?php if (!($_shippingRateGroups = $this-&gt;getShippingRates())): ?&gt;
  &lt;strong&gt;&lt;?php echo $this-&gt;__('Sorry, no quotes are available for this order at this time.') ?&gt;&lt;/strong&gt;
  </code></pre>
  
  
  
  <pre><code>&lt;dl class="shipment-methods"&gt;
  &lt;?php foreach ($_shippingRateGroups as $code =&gt; $_rates): ?&gt;
      &lt;dt&gt;&lt;?php echo $this-&gt;getCarrierName($code) ?&gt;&lt;/dt&gt;
      &lt;dd&gt;
          &lt;ul&gt;
  
  &lt;?php foreach ($_rates as $_rate): ?&gt;
              &lt;li&gt;
                 &lt;?php if ($_rate-&gt;getErrorMessage()): ?&gt;
                  &lt;ul class="messages"&gt;&lt;li class="error-msg"&gt;&lt;ul&gt;&lt;li&gt;&lt;?php echo $_rate-&gt;getErrorMessage() ?&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;
                 &lt;?php else: ?&gt;
                      &lt;input name="shipping_method" type="radio" value="&lt;?php echo $_rate-&gt;getCode() ?&gt;" id="s_method_&lt;?php echo $_rate-&gt;getCode() ?&gt;"&lt;?php if($_rate-&gt;getCode()===$this-&gt;getAddressShippingMethod()) echo ' checked="checked"' ?&gt; onclick="shippingMethodStep.save()"/&gt;
                      &lt;label for="s_method_&lt;?php echo $_rate-&gt;getCode() ?&gt;"&gt;&lt;?php echo $_rate-&gt;getMethodTitle() ?&gt;
                      &lt;strong&gt;
                      &lt;?php $_excl = $this-&gt;getShippingPrice($_rate-&gt;getPrice(), $this-&gt;helper('tax')-&gt;displayShippingPriceIncludingTax()); ?&gt;
                      &lt;?php $_incl = $this-&gt;getShippingPrice($_rate-&gt;getPrice(), true); ?&gt;
  
                      &lt;?php echo $_excl; ?&gt;
                      &lt;?php if ($this-&gt;helper('tax')-&gt;displayShippingBothPrices() &amp;&amp; $_incl != $_excl): ?&gt;
                          (&lt;?php echo $this-&gt;__('Incl. Tax'); ?&gt; &lt;?php echo $_incl; ?&gt;)
                      &lt;?php endif; ?&gt;
                      &lt;/strong&gt;
                      &lt;/label&gt;
                 &lt;?php endif ?&gt;
              &lt;/li&gt;
          &lt;?php endforeach; ?&gt;
  
  &lt;/ul&gt;
      &lt;/dd&gt;
  &lt;?php endforeach; ?&gt;
  </code></pre>
  
  <p>
  </p>
  
  <hr>
  
  <p>can you tell me where should I replace or add that solution.</p>
  
  <p>or maybe another solution for autoselect jne shipping method</p>