title: Magento: how to include a .phtml from one module in another
body: <p>I have two modules installed. </p>
  
  <p>One module (module1) that was developed for onepage checkout and it is working fine. It replaces available.phtml with some new shipping methods etc.</p>
  
  <p>I want to include this available in a new cashier (module2) that is not based on the onepage checkout. So I tried doing this:</p>
  
  <pre><code>&lt;?php echo $this-&gt;getLayout()-&gt;createBlock('core/template')-&gt;setTemplate('unifaun/checkout/onepage/shipping_method/available.phtml')-&gt;toHtml(); ?&gt;
  </code></pre>
  
  <p>It successfully includes the available.phtml. However, available.phtml does not behave as it should. </p>
  
  <p>The first line in available.phtml is:</p>
  
  <pre><code>&lt;?php if (!($_shippingRateGroups = $this-&gt;getShippingRates())): ?&gt;
      &lt;p&gt;&lt;?php echo Mage::helper('unifaun')-&gt;__('No shipping methods that suit your order were found. Please contact customer service.') ?&gt;&lt;/p&gt;
  &lt;?php else: ?&gt;
  etc... 
  </code></pre>
  
  <p>The problem is that I don't get any shipping rates etc as I do in onepage checkout. I have also manually entered the following:</p>
  
  <pre><code>&lt;?php       
      $country = Mage::getStoreConfig('shipping/origin/country_id');
      $postcode = Mage::getStoreConfig('shipping/origin/postcode');
      $city = Mage::getStoreConfig('shipping/origin/city');
  
      $quote = Mage::getSingleton('checkout/session')-&gt;getQuote();
      $quote-&gt;getShippingAddress()
          -&gt;setCountryId($country)
          -&gt;setCity($city)
          -&gt;setPostcode($postcode)
          -&gt;setCollectShippingRates(true);        
  ?&gt;
  </code></pre>
  
  <p>So my question is what I need to do to make the following line work correctly so that the code actually gets the availaable shipping methods etc..., as it does when the module is included in onepage checkout.</p>
  
  <pre><code>$_shippingRateGroups = $this-&gt;getShippingRates()
  </code></pre>
  
  <p>I'm not sure if this is enough information to solve this problem, but I thought I make it a try and post it and see if anyone know what I'm doing wrong. :)</p>
  
  <p>Cheers!</p>