<?php if ($error_warning) { ?>
<div class="alert alert-warning"><i class="fa fa-exclamation-circle"></i> <?php echo $error_warning; ?></div>
<?php } ?>

<?php if ($shipping_methods) { ?>
	<p><?php echo $text_shipping_method; ?></p>

	<table class="table table-hover">
	<?php foreach ($shipping_methods as $shipping_method) { ?>
		<?php /* ?><p><strong><?php echo $shipping_method['title']; ?></strong></p><?php */ ?>
		<?php if (!$shipping_method['error']) { ?>
			<?php foreach ($shipping_method['quote'] as $quote) { ?>
			<tr>
				<td>
					<div class="radio">
						<label for="<?php echo $quote['code']; ?>">
							<?php /*if ($quote['code'] == $code || !$code) { ?>
								<?php $code = $quote['code']; ?>
								<input type="radio" name="shipping_method" value="<?php echo $quote['code']; ?>" checked="checked" />
							<?php } else { ?>
								<input type="radio" name="shipping_method" value="<?php echo $quote['code']; ?>" />
							<?php }*/ ?>
							<input type="radio" name="shipping_method" id="<?php echo $quote['code']; ?>" value="<?php echo $quote['code']; ?>" />
							<span><?php echo $quote['title']; ?></span>
						</label>
					</div>
				</td>
				<td align="right">
					<div class="radio">
						<label for="<?php echo $quote['code']; ?>">
							<strong><?php echo $quote['text']; ?></strong>
						</label>
					</div>
				</td>
			</tr>
			<?php } ?>
		<?php } else { ?>
			<div class="alert alert-danger"><?php echo $shipping_method['error']; ?></div>
		<?php } ?>
	<?php } ?>
	</table>

<style>
#collapse-shipping-method .radio { margin: 0; }
#collapse-shipping-method .radio label { display: block; padding: 8px; }
#collapse-shipping-method .radio input { position: relative; margin: 0; }
#collapse-shipping-method .radio input:checked + span { font-weight: bold; }

#collapse-shipping-method .table { border-bottom: 1px solid rgba(0,0,0,0.05); }
#collapse-shipping-method .table td { padding: 0; }

/* #collapse-shipping-method .table tr:nth-child(odd) td { background: rgba(0,0,0,0.03); } */
</style>

<?php } ?>

<p><strong><?php echo $text_comments; ?></strong></p>
<p><textarea name="comment" rows="3" class="form-control"><?php echo $comment; ?></textarea></p>

<div class="buttons">
	<div class="pull-right">
		<input type="button" value="<?php echo $button_continue; ?>" id="button-shipping-method" data-loading-text="<?php echo $text_loading; ?>" class="btn btn-primary" />
	</div>
</div>
