<?php
/**
 * Avalanche for Magento 1.8+
 * Designed by Fast Division (http://fastdivision.com)
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the EULA
 * that is bundled with this package in the file license.txt.
 * It is also available through the world-wide-web at this URL:
 * http://fastdivision.com/legal/license.txt
 *
 * @author     Fast Division
 * @version    1.5.0
 * @copyright  Copyright 2013 Fast Division
 * @license    http://fastdivision.com/legal/license.txt
 */
?>
<fieldset id="shipping-method-container">
<?php if ($this->getCanEditShippingMethod() || !$this->getCurrentShippingRate()):?>
        <?php if ($groups = $this->getShippingRateGroups()):?>
            <?php $currentRate = $this->getCurrentShippingRate(); ?>
            <select name="shipping_method" id="shipping_method" style="width:250px;" class="required-entry">
            <?php if (!$currentRate):?>
                <option value=""><?php echo $this->__('Please select a shipping method...') ?></option>
            <?php endif;?>
            <?php foreach ($groups as $code => $rates):?>
                <optgroup label="<?php echo $this->escapeHtml($this->getCarrierName($code)) ?>" style="font-style:normal;">
                <?php foreach ($rates as $rate):?>
                    <option value="<?php echo $this->renderShippingRateValue($rate)?>"<?php echo ($currentRate === $rate) ? ' selected="selected"' : '' ;?>>
                        <?php echo $this->renderShippingRateOption($rate)?>
                    </option>
                <?php endforeach;?>
                </optgroup>
            <?php endforeach;?>
            </select>
        <?php else: ?>
            <p><strong><?php echo $this->__('Sorry, no quotes are available for this order at this time.') ?></strong></p>
        <?php endif;?>
<?php else: ?>
    <p><strong><?php echo $this->renderShippingRateOption($this->getCurrentShippingRate())?></strong></p>
<?php endif; ?>
</fieldset>
<div style="display:none" id="shipping_method_update"><div class="white-box-inner"><p><?php echo $this->__('Please update order data to get shipping methods and rates') ?></p></div></div>
