{*
* 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='Your business information' d='Modules.Agilemultisellerpro.Business'}</h3>
    <form action="{$link->getModuleLink('agilemultisellerpro', 'sellerbusiness', [], true)|escape:'htmlall':'UTF-8'}"
      enctype="multipart/form-data" method="post" class="form-horizontal std">
      <input type="hidden" name="token" value="{$token|escape:'htmlall':'UTF-8'}" />
      {if isset($select_address)}<input type="hidden" name="select_address" value="{$select_address|intval}" />{/if}
      <div>
        {block "form_fields"}
          {foreach from=$formFields item="field"}
            {if $field.name === 'hide_block_start' }
              <div class="form-group row text-xs-center hide-block">
                <button class="btn btn-link" type="button" onclick="$('#seller_form_hide_block').slideToggle();$('.form-group.hide-block .material-icons').toggle()">
                  {$field.value|escape:'htmlall':'UTF-8'}
                  <i class="material-icons" aria-hidden="true">arrow_downward</i>
                  <i class="material-icons" aria-hidden="true" style="display:none">arrow_upward</i>
                </button>
              </div>
              <div id="seller_form_hide_block" style="display:none">
              {continue}
            {/if}

            {if $field.name === 'hide_block_end' }
              </div>
              {continue}
            {/if}
            {block "form_field"}


              {if $field.isAgileForm}
                {include file="module:agilemultisellerpro/views/templates/front/_partials/form-fields.tpl"
            							languages=$languages
            							field=$field
            						}
              {elseif $field.type === "password"}
                <div class="field-password-policy">
                  {form_field field=$field}
                </div>
              {else}
                {form_field field=$field}
              {/if}
            {/block}
          {/foreach}
        {/block}
      </div>

      {if $is_multiple_shop_installed}

        <div class="form-group">
          <label for="shop_name" class="control-label agile-col-sm-3 agile-col-md-3 agile-col-lg-3 agile-col-xl-3">
            <span>{l s='Shop Name' d='Modules.Agilemultisellerpro.Business'}</span>
          </label>
          <div class=" agile-col-sm-7 agile-col-md-7 agile-col-lg-7 agile-col-xl-7">
            <div class="row">
              <div class="agile-col-sm-9 agile-col-md-9 agile-col-lg-9 agile-col-xl-9">
                <input type="text" id="shop_name" name="shop_name" class="form-control"
{*                  value="{if isset($smarty.post.shop_name)}{$smarty.post.shop_name|escape:'htmlall':'UTF-8'}{else}{if isset($seller_shop->name)}{$seller_shop->name|escape:'htmlall':'UTF-8'}{/if}{/if}"*}
                  class="form-control" />
              </div>
            </div>
          </div>
        </div>

        <div class="form-group">
          <label for="shop_url" class="control-label agile-col-sm-3 agile-col-md-3 agile-col-lg-3 agile-col-xl-3">
            <span>{l s='Shop full Url' d='Modules.Agilemultisellerpro.Business'}</span>
          </label>
          <div class=" agile-col-sm-7 agile-col-md-7 agile-col-lg-7 agile-col-xl-7">
            <div class="row">
              <div class="agile-col-sm-9 agile-col-md-9 agile-col-lg-9 agile-col-xl-9">
                <input type="text" id="shop_url" name="shop_url" class="form-control" disabled=true
{*                  value="{$seller_shopurl->getURL(true)|escape:'htmlall':'UTF-8'}"  class="form-control" />*}
              </div>
            </div>
          </div>
        </div>
        <div class="form-group">
          <label for="virtual_uri" class="control-label agile-col-sm-3 agile-col-md-3 agile-col-lg-3 agile-col-xl-3">
            <span>{l s='Virtual Uri' d='Modules.Agilemultisellerpro.Business'}</span>
          </label>
          <div class=" agile-col-sm-7 agile-col-md-7 agile-col-lg-7 agile-col-xl-7">
            <div class="row">
              <div class="agile-col-sm-9 agile-col-md-9 agile-col-lg-9 agile-col-xl-9">
                <input type="text" id="virtual_uri" name="virtual_uri" class="form-control"
{*                  value="{if isset($smarty.post.virtual_uri)}{$smarty.post.virtual_uri|escape:'htmlall':'UTF-8'}{else}{if isset($seller_shopurl)}{$seller_shopurl->virtual_uri|escape:'htmlall':'UTF-8'}{/if}{/if}"*}
                  class="form-control" />
              </div>
            </div>
          </div>
        </div>

        {*
				<div class="form-group" style="display:{if isset($seller_choose_theme) && $seller_choose_theme==1}{else}none{/if}">
					<label for="seller_theme" class="control-label agile-col-sm-3 agile-col-md-3 agile-col-lg-3 agile-col-xl-3">
						<span>{l s='Virtual Shop Theme' d='Modules.Agilemultisellerpro.Business'}</span>
					</label>
					<div class=" agile-col-sm-7 agile-col-md-7 agile-col-lg-7 agile-col-xl-7">
						<div class="row">
							<div class="agile-col-sm-9 agile-col-md-9 agile-col-lg-9 agile-col-xl-9">
								<select id="theme_name" name="theme_name" onchange="themeChangeHandler()">
									{foreach from=$themes item=theme}
										<option value="{$theme->id}" {if $sellerinfo->theme_name==$theme->name}selected{/if}>{$theme->name}</option>
									{/foreach}
								</select>
								<img id="seller_theme_preview" src="{$base_dir}themes/{$theme->directory}/preview.jpg" class="responsive">
							</div>
						</div>
					</div>
				</div>
				*}

        {*
				<div class="form-group">
					<label class="control-label agile-col-sm-3 agile-col-md-3 agile-col-lg-3 agile-col-xl-3" for="meta_title_{$id_language_current}">
						<span>
							{l s='Meta Title' d='Modules.Agilemultisellerpro.Business'}
						</span>
					</label>
					<div class="agile-col-sm-7 agile-col-md-7 agile-col-lg-7 agile-col-xl-7">
						{include file="module:agilemultisellerpro/views/templates/front/products/input_text_lang.tpl"
							languages=$languages
							input_value=$sellerinfo->meta_title
							input_name='meta_title'
						}
					</div>
				</div>


				<div class="form-group">
					<label class="control-label agile-col-sm-3 agile-col-md-3 agile-col-lg-3 agile-col-xl-3" for="meta_tag_{$id_language_current}">
						<span>
							{l s='Meta Tag' d='Modules.Agilemultisellerpro.Business'}
						</span>
					</label>
					<div class="agile-col-sm-7 agile-col-md-7 agile-col-lg-7 agile-col-xl-7">
						{include file="module:agilemultisellerpro/views/templates/front/products/input_text_lang.tpl"
							languages=$languages
							input_value=$sellerinfo->meta_keywords
							input_name='meta_keywords'
						}
					</div>
				</div>

				<div class="form-group">
					<label class="control-label agile-col-sm-3 agile-col-md-3 agile-col-lg-3 agile-col-xl-3" for="meta_description_{$id_language_current}">
						<span>
							{l s='Meta Description' d='Modules.Agilemultisellerpro.Business'}
						</span>
					</label>
					<div class="agile-col-sm-7 agile-col-md-7 agile-col-lg-7 agile-col-xl-7">
						{include file="module:agilemultisellerpro/views/templates/front/products/input_text_lang.tpl"
							languages=$languages
							input_value=$sellerinfo->meta_description
							input_name='meta_description'
						}
					</div>
				</div>
				*}

      {/if}

      {if isset($iszipcodefilterinstalled) && $iszipcodefilterinstalled==1}
        {if isset($filter_mode) && $filter_mode==2}
          <div class="form-group">
            <label for="service_zipcodes" class="control-label agile-col-sm-3 agile-col-md-3 agile-col-lg-3 agile-col-xl-3">
              <span class="label-tooltip" data-toggle="tooltip"
                title="{l s='Please enter Post code list separated by comma for example: 1232,3231, or leave it empty if there is no restrictions' d='Modules.Agilemultisellerpro.Business'}">{l s='Service Area Restrictions' d='Modules.Agilemultisellerpro.Business'}</span>
            </label>
            <div class=" agile-col-sm-7 agile-col-md-7 agile-col-lg-7 agile-col-xl-7">
              <div class="row">
                <div class="agile-col-sm-9 agile-col-md-9 agile-col-lg-9 agile-col-xl-9">
                  <input type="text" id="service_zipcodes" name="service_zipcodes" class="form-control"
                    value="{if isset($smarty.post.service_zipcodes)}{$smarty.post.service_zipcodes|escape:'htmlall':'UTF-8'}{else}{$sellerinfo->getServiceZipcodes()|escape:'htmlall':'UTF-8'}{/if}"
                    class="form-control" />
                </div>
              </div>
            </div>
          </div>
        {else}
          <div class="form-group">
            <label for="service_distance" class="control-label agile-col-sm-3 agile-col-md-3 agile-col-lg-3 agile-col-xl-3">
              <span class="label-tooltip" data-toggle="tooltip"
                title="{l s='Please maximum distance(KM) you will serve from your location' d='Modules.Agilemultisellerpro.Business'}">{l s='Maximum Service Distance' d='Modules.Agilemultisellerpro.Business'}</span>
            </label>
            <div class=" agile-col-sm-7 agile-col-md-7 agile-col-lg-7 agile-col-xl-7">
              <div class="row">
                <div class="agile-col-sm-9 agile-col-md-9 agile-col-lg-9 agile-col-xl-9">
                  <input type="text" id="service_distance" name="service_distance" class="form-control"
                    value="{if isset($smarty.post.service_distance)}{$smarty.post.service_distance|escape:'htmlall':'UTF-8'}{else}{$sellerinfo->getServiceDistance()|escape:'htmlall':'UTF-8'}{/if}"
                    class="form-control" />
                </div>
              </div>
            </div>
          </div>
        {/if}
      {/if}

      {block name='customer_form_footer'}
        <footer class="form-footer clearfix text-xs-center">
          <input type="hidden" name="submitSellerinfo" value="1">
          {block "form_buttons"}
            <button class="btn btn-primary form-control-submit" data-link-action="save-customer" type="submit">
              {l s='Save' d='Shop.Theme.Actions'}
            </button>
          {/block}
        </footer>
      {/block}
    </form>
  {/if}
{/block}
