{*
* 2007-2024 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
*  @author    PrestaShop SA <contact@prestashop.com>
*  @copyright 2007-2024 PrestaShop SA
*  @license   http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
*  International Registered Trademark & Property of PrestaShop SA
*}
{extends file='module:agilemultisellerpro/views/templates/front/layouts/selleraccount.tpl'}

{block name='page_content'}
    {if isset($isSeller) AND $isSeller}


        <h3>{l s='Shipping locations and costs' d='Modules.Agilemultisellerpro.Shipping'}</h3>

        <div class="ranges_not_follow warn" style="display:none">
            <label>{l s='Ranges are not correctly ordered:' d='Admin.Shipping.Notification'}</label>
            <a href="#" onclick="checkRangeContinuity(true); return false;" class="btn btn-default">{l s='Reordering' d='Admin.Shipping.Notification'}</a>
        </div>

		<div>
			<ul class="nav nav-tabs" role="tablist">
				<li class="nav-item">
					<a class="nav-link active" id="agile_costs-tab" href="#agile_costs" data-toggle="tab" role="tab" aria-controls="agile_costs" aria-selected="true">{l s='Costs' d='Modules.Agilemultisellerpro.Shipping'}</a>
				</li>

				<li class="nav-item">
					<a class="nav-link" id="agile_locations-tab" href="#agile_locations" data-toggle="tab" role="tab" aria-controls="agile_locations" aria-selected="false">{l s='Locations' d='Modules.Agilemultisellerpro.Shipping'}</a>
				</li>
			</ul>

			<div class="tab-content">
				<div id="agile_costs" class="tab-pane fade active in" role="tabpanel" aria-labelledby="agile_costs-tab">
					<form id="step_carrier_ranges" method="post" enctype="multipart/form-data">
						<div class="form-group row">
							<label class="col-md-5 form-control-label" for="field-out_of_stock">
								{l s='Free shipping' d='Modules.Agilemultisellerpro.Shipping'}
							</label>
							<div class="col-md-7 js-input-column form-options_container">
								<label class="radio-inline" for="is_free_on">
									<span class="custom-radio">
										<input name="is_free" id="is_free_on" type="radio" value="1"{if $isFree} checked{/if}>
										<span></span>
									</span>
									{l s='Yes' d='Modules.Agilemultisellerpro.Shipping'}
								</label>

								<label class="radio-inline" for="is_free_off">
									<span class="custom-radio">
										<input name="is_free" id="is_free_off" type="radio" value="0"{if !$isFree} checked{/if}>
										<span></span>
									</span>
									{l s='No' d='Modules.Agilemultisellerpro.Shipping'}
								</label>
							</div>
						</div>

						<div class="form-group row ">
							<label class="col-md-5 form-control-label" for="field-out_of_stock">
								{l s='Billing' d='Modules.Agilemultisellerpro.Shipping'}
							</label>
							<div class="col-md-7 js-input-column form-options_container">
								<label class="radio-inline" for="billing_price">
									<span class="custom-radio">
										<input name="shipping_method" id="billing_price" type="radio" value="2" {if $shipping_method == 2} checked{/if}>
										<span></span>
									</span>
									{l s='According to total price' d='Modules.Agilemultisellerpro.Shipping'}
								</label>

								<label class="radio-inline" for="billing_weight">
									<span class="custom-radio">
										<input name="shipping_method" id="billing_weight" type="radio" value="1" {if $shipping_method == 1 || $shipping_method == 3} checked{/if}>
										<span></span>
									</span>
									{l s='According to total weight' d='Modules.Agilemultisellerpro.Shipping'}
								</label>
							</div>
						</div>

						<div class="form-group row ">
							<label class="col-md-5 form-control-label" for="field-out_of_stock">
								Tax
							</label>
							<div class="col-md-7 js-input-column form-options_container">
								{$tax_rules_group_name|escape:'html':'UTF-8'}
							</div>
						</div>

						<div class="form-group row mb-3">
							<label class="col-md-5 form-control-label" >
								{l s='Out-of-range behavior' d='Modules.Agilemultisellerpro.Shipping'}
							</label>
							<div class="col-md-7 js-input-column form-options_container">
								{$range_behavior|escape:'html':'UTF-8'}
							</div>
						</div>

						<div class="row mb-0">
							<div id="alert-container"  class="col-xs-12"></div>
						</div>

						{include file="module:agilemultisellerpro/views/templates/front/shipping/rangestable.tpl"}

						<div class="row p-0 p-md-1 ">
							<div class="col-xs-12 col-md-6 text-xs-center text-md-left pt-1">
								<a class="btn btn-link"
								href="{$sellerCarrierListUrl|escape:'htmlall':'UTF-8'}">
									<i class="icon-th-list"></i>{l s=' Back to carriers list' d='Modules.Agilemultisellerpro.Product'}
								</a>
							</div>
							<div class="col-xs-12 col-md-6 text-xs-center text-md-right pt-1 pb-2">
								<button class="btn btn-primary form-control-submit"
										name="submitCarrierRanges" value="1"
										data-link-action="save-customer" type="submit">
									{l s='Save' d='Shop.Theme.Actions'}
								</button>
							</div>
						</div>

					</form>
				</div>

				<div id="agile_locations" class="tab-pane fade mt-1" role="tabpanel" aria-labelledby="agile_locations-tab">
					{include file="module:agilemultisellerpro/views/templates/front/shipping/locations.tpl" locations=$locations}
				</div>

			</div>
		</div>
    {/if}
{/block}
