{{ header }}

<div class="container">
	<ul class="breadcrumb">
		{% for breadcrumb in breadcrumbs %}
			<li><a href="{{ breadcrumb['href'] }}">{{ breadcrumb['text'] }}</a></li>
		{% endfor %}
	</ul>
	{% if (error_warning) %}
		<div class="alert alert-danger"><i class="fa fa-exclamation-circle"></i> {{ error_warning }}
			<button type="button" class="close" data-dismiss="alert">&times;</button>
		</div>
	{% endif %}
	<div class="row">
		{{ column_left }}
		{% if (column_left and column_right) %}
			{% set class = 'col-sm-6' %}
		{% elseif (column_left or column_right) %}
			{% set class = 'col-sm-9' %}
		{% else %}
			{% set class = 'col-sm-12' %}
		{% endif %}
		<div id="content" class="{{ class }}">
			{{ content_top }}
			<h1 class="text-center">{{ heading_title }}</h1>
			<div class="so-onepagecheckout {% if (is_logged_in) %} is_customer{% endif %} {{ setting_so_onepagecheckout_general['so_onepagecheckout_layout'] == 2 ? 'layout2' : '' }}">
				<div class="row">
					<div class="col-left col-sm-4{% if (not is_logged_in) %} col-md-5{% endif %}">
						{% if (not is_logged_in) %}
							<div class="checkout-content login-box">
								<h2 class="secondary-title">{{ text_checkout_create_account_login }}</h2>
								{% if (setting_so_onepagecheckout_layout_setting['so_onepagecheckout_register_checkout'] == 1) %}
									<div class="box-inner">
										<div class="radio">
											<label><input type="radio" name="account" value="register" {% if (default_auth == 'register') %} checked="checked" {% endif %}>{{ text_register }}</label>
										</div>
										{% if (allow_guest_checkout and setting_so_onepagecheckout_layout_setting['so_onepagecheckout_guest_checkout'] == 1) %}
											<div class="radio">
												<label><input type="radio" name="account" value="guest" {% if (default_auth == 'guest') %} checked="checked" {% endif %} />{{ text_guest }}</label>
											</div>
										{% endif %}
										{% if (setting_so_onepagecheckout_layout_setting['so_onepagecheckout_enable_login'] == 1) %}
											<div class="radio">
												<label><input type="radio" name="account" value="login" {% if (default_auth == 'login') %} checked="checked" {% endif %}>{{ text_returning_customer }}</label>
											</div>
										{% endif %}
									</div>
								{% endif %}
							</div>
							{% if (setting_so_onepagecheckout_layout_setting['so_onepagecheckout_enable_login'] == 1) %}
								<div class="checkout-content checkout-login">
									<fieldset>
										<h2 class="secondary-title">{{ text_returning_customer }}</h2>
										<div class="box-inner">
											<div class="form-group">
												<label>{{ entry_email }}</label>
												<input type="text" name="login_email" value="" id="input-login_email" class="form-control"/>
											</div>
											<div class="form-group">
												<label>{{ entry_password }}</label>
												<input type="password" name="login_password" value="" id="input-login_password" class="form-control"/>
												<a href="{{ forgotten }}">{{ text_forgotten }}</a>
											</div>
											<div class="form-group">
												<input type="button" value="{{ button_login }}" id="button-login" data-loading-text="{{ text_loading }}" class="btn-primary button"/>
											</div>
										</div>
									</fieldset>
								</div>
								{{ register_form }}
							{% endif %}
						{% else %}
							{{ payment_address }}

							<!-- Chronoposts shipments -->
							<div class="checkout-content chrono-pickup">
								<h2 class="secondary-title">
									Chronopost Pick-up
								</h2>
								<div class="radio">
									<label>
										<input type="checkbox" id="check-chronopost" name="chonopost_pickup">
										Receber a tua encomenda perto de ti
									</label>
									<img src="image/chronopost.png" class="img-responsive pull-right">
								</div>

								<div class="well hidden">
									<h6>Encontrar um ponto Pickup</h6>
									<div class="input-group">
										<input type="text" name="pickup-point" value="" placeholder="Pesquisa por pontos de recolha..." class="form-control">
										<span class="input-group-btn">
										<input type="button" value="OK" id="button-chronopost" data-loading-text="A carregar..." class="btn btn-primary">
									</span>
									</div>
								</div>
								<div class="panel-group" id="pickup-list" role="tablist" aria-multiselectable="false"></div>
							</div>
							{% if is_shipping_required %}
								{{ shipping_address }}
							{% endif %}
						{% endif %}
					</div>
					<div class="col-right col-sm-8 {% if (not is_logged_in) %} col-md-7{% endif %}">
						<div class="row">
							<div class="col-xs-12">
								{{ payment_methods }}
							</div>
							<div class="col-xs-12">
								{% if (is_shipping_required) %}
									{{ shipping_methods }}
								{% endif %}
							</div>
						</div>

						<section class="section-right">
							<div id="coupon_voucher_reward">
								{{ coupon_voucher_reward }}
							</div>
							{{ cart }}
							<div class="checkout-content confirm-section">
								<h2 class="secondary-title">{{ text_comments }}</h2>
								<div class="box-inner">
									{% if (setting_so_onepagecheckout_layout_setting['comment_status']) %}
										<div class="form-group">
											<textarea name="comment" cols="3" class="form-control {% if (setting_so_onepagecheckout_layout_setting['require_comment_status']) %} requried{% endif %}">{{ comment }}</textarea>
										</div>
									{% endif %}
									{% if (entry_newsletter and setting_so_onepagecheckout_layout_setting['show_newsletter']) %}
										<div class="checkbox check-newsletter">
											<label for="newsletter">
												<input type="checkbox" name="newsletter" value="1" id="newsletter"/>
												{{ entry_newsletter }}
											</label>
										</div>
									{% endif %}

									{% if (text_privacy and setting_so_onepagecheckout_layout_setting['show_privacy']) %}
										<div class="checkbox check-privacy">
											<label>
												<input type="checkbox" name="privacy" value="1"/>
												{{ text_privacy }}
											</label>
										</div>
									{% endif %}

									{% if (text_agree and setting_so_onepagecheckout_layout_setting['show_term']) %}
										<div class="checkbox check-terms">
											<label>
												<input type="checkbox" name="agree" value="1"/>
												{{ text_agree }}
											</label>
										</div>
									{% endif %}
									<div class="confirm-order">
										<button id="so-checkout-confirm-button" data-loading-text="{{ text_loading }}" class="btn btn-primary confirm-button">{{ text_confirm_order }}</button>
									</div>
								</div>
							</div>
						</section>
					</div>
				</div>
			</div>
			{{ content_bottom }}
		</div>
	</div>
</div>
{{ footer }}