{{ header }}
<div class="pts-container">
  <ul class="pts-breadcrumb">
	{% for breadcrumb in breadcrumbs %}
    <li><a href="{{ breadcrumb.href}}">{{ breadcrumb.text }}</a></li>
    {% endfor %}
  </ul>
  {% if success %}
  <div class="alert pts-alert-success"><i class="fa fa-check-circle"></i> {{ success }}</div>
	{% endif %}
	{% if error_warning %}
  <div class="alert alert-danger"><i class="fa fa-exclamation-circle"></i> {{ error_warning }}</div>
  {% endif %}
  <div class="pts-row">{{ column_left }}
	{% if column_left and column_right %}
    {% set class = 'pts-col-sm-6' %}
    {% elseif column_left or column_right %}
    {% set class = 'pts-col-sm-9' %}
    {% else %}
    {% set class = 'pts-col-sm-12' %}
    {% endif %}
    <div id="pts-content" class="{{ class }}">{{ content_top }}
      <h1>{{ heading_title }}</h1>
      <form action="{{ action }}" method="post" enctype="multipart/form-data" class="pts-form-horizontal">
        <fieldset>
         <div class="pts-form-group required">
			<label class="pts-col-sm-2 pts-control-label" for="input-storename">{{ entry_name }}</label>
			<div class="pts-col-sm-10">
			  <input type="text" name="seller_name" disabled value="{{ seller_name }}" placeholder="{{ entry_name }}" id="input-name" class="pts-form-control" />
			  <input type="hidden" name="seller_name" value="{{ seller_name }}" />
			  <input type="hidden" name="seller_id" value="{{ seller_id }}" />
			</div>
		</div>
		<div class="pts-form-group required">
			<label class="pts-col-sm-2 pts-control-label" for="input-storename">{{ entry_storename }}</label>
			<div class="pts-col-sm-10">
			  <input type="text" name="store_name" value="{{ store_name }}" placeholder="{{ entry_storename }}" id="input-storename" class="pts-form-control" />
				{% if error_storename %}
			  <div class="text-danger">{{ error_storename }}</div>
			  {% endif %}
			</div>
		</div>
		<div class="pts-form-group">
			<label class="pts-col-sm-2 pts-control-label">{{ entry_storelogo }}</label>
			<div class="pts-col-sm-10"><a href="" id="thumb-image" data-toggle="image" class="img-thumbnail"><img src="{{ thumb }}" alt="" title="" data-placeholder="{{ placeholder }}" /></a>
			  <input type="hidden" name="store_logo" value="{{ store_logo }}" id="input-storelogo" />
			</div>
		</div>
		<div class="pts-form-group required">
			<label class="pts-col-sm-2 pts-control-label" for="input-storeemail">{{ entry_storeemail }}</label>
			<div class="pts-col-sm-10">
			  <input type="text" name="store_email" value="{{ store_email }}" placeholder="{{ entry_storeemail }}" id="input-storeemail" class="pts-form-control" />
				{% if error_storeemail %}
			  <div class="text-danger">{{ error_storeemail }}</div>
			  {% endif %}
			</div>
		</div>
		<div class="pts-form-group required">
			<label class="pts-col-sm-2 pts-control-label" for="input-storephone">{{ entry_storephone }}</label>
			<div class="pts-col-sm-10">
			  <input type="text" name="store_phone" value="{{ store_phone }}" placeholder="{{ entry_storephone }}" id="input-storephone" class="pts-form-control" />
				{% if error_storephone %}
			  <div class="text-danger">{{ error_storephone }}</div>
			  {% endif %}
			</div>
		</div>
		<div class="pts-form-group">
			<label class="pts-col-sm-2 pts-control-label">{{ entry_storebanner }}</label>
			<div class="pts-col-sm-10"><a href="" id="banner-thumb-image" data-toggle="image" class="img-thumbnail"><img src="{{ banner_thumb }}" alt="" title="" data-placeholder="{{ placeholder }}" /></a>
			  <input type="hidden" name="store_banner" value="{{ store_banner }}" id="input-storebanner" /><br>
			  {{ entry_storebanner_desc }}
			</div>
		</div>
		<div class="pts-form-group required">
			<label class="pts-col-sm-2 pts-control-label" for="input-storedescription">{{ entry_storedescription }}</label>
			<div class="pts-col-sm-10">
				<textarea name="store_description" data-toggle="summernote" id="input-storedescription" class="pts-form-control summernote">{{ store_description }}</textarea>
				{% if error_storedescription %}
			  <div class="text-danger">{{ error_storedescription }}</div>
			  {% endif %}
			</div>
		</div>
		<div class="pts-form-group required">
			<label class="pts-col-sm-2 pts-control-label" for="input-storeaddress">{{ entry_storeaddress }}</label>
			<div class="pts-col-sm-10">
			  <textarea name="store_address" class="pts-form-control" rows="5">{{ store_address }}</textarea>
				{% if error_storeaddress %}
			  <div class="text-danger">{{ error_storeaddress }}</div>
			  {% endif %}
			</div>
		</div>
		<div class="pts-form-group required">
			<label class="pts-col-sm-2 pts-control-label" for="input-storecity">{{ entry_storecity }}</label>
			<div class="pts-col-sm-10">
			  <input type="text" name="store_city" value="{{ store_city }}" placeholder="{{ entry_storecity }}" id="input-storecity" class="pts-form-control" />
				{% if error_storecity %}
			  <div class="text-danger">{{ error_storecity }}</div>
			  {% endif %}
			</div>
		</div>
		<div class="pts-form-group required">
		<label class="pts-col-sm-2 pts-control-label" for="input-storecountry">{{ entry_storecountry }}</label>
		<div class="pts-col-sm-10">
		  <select name="store_country" id="input-storecountry" onchange="country(this,'{{ store_state }}');" class="pts-form-control">
			<option value="">{{ text_select }}</option>
			{% for country in countries %}
			{% if country.country_id == store_country %}
			<option value="{{ country.country_id }}" selected="selected">{{ country.name }}</option>
			{% else %}
			<option value="{{ country.country_id }}">{{ country.name }}</option>
			{% endif %}
			{% endfor %}
		  </select>
		  {% if error_storecountry %}
		  <div class="text-danger">{{ error_storecountry }}</div>
		  {% endif %}
		</div>
	  </div>
	  <div class="pts-form-group required">
		<label class="pts-col-sm-2 pts-control-label" for="input-storestate">{{ entry_storezone }}</label>
		<div class="pts-col-sm-10">
		  <select name="store_state" id="input-storestate" class="pts-form-control">
		  </select>
		  {% if error_storestate %}
		  <div class="text-danger">{{ error_storestate }}</div>
		  {% endif %}
		</div>
		</div>
		<div class="pts-form-group required">
			<label class="pts-col-sm-2 pts-control-label" for="input-storezipcode">{{ entry_storepostcode }}</label>
			<div class="pts-col-sm-10">
			  <input type="text" name="store_zipcode" value="{{ store_zipcode }}" placeholder="{{ entry_storepostcode }}" id="input-storezipcode" class="pts-form-control" />
			  {% if error_storezipcode %}
			  <div class="text-danger">{{ error_storezipcode }}</div>
			  {% endif %}
			</div>
		</div>
		<div class="pts-form-group">
			<label class="pts-col-sm-2 pts-control-label" for="input-storeshipping">{{ entry_storeshippingpolicy }}</label>
			<div class="pts-col-sm-10">
			  <textarea name="store_shipping_policy" data-toggle="summernote" id="input-storeshipping" class="pts-form-control summernote">{{ store_shipping_policy }}</textarea>
			  {% if error_storeshipping %}
			  <div class="text-danger">{{ error_storeshipping }}</div>
			  {% endif %}
			</div>
		</div>
		<div class="pts-form-group">
			<label class="pts-col-sm-2 pts-control-label" for="input-storereturn">{{ entry_storereturn }}</label>
			<div class="pts-col-sm-10">
			  <textarea name="store_return_policy" data-toggle="summernote" id="input-storereturn" class="pts-form-control summernote">{{ store_return_policy }}</textarea>
			  {% if error_storereturn %}
			  <div class="text-danger">{{ error_storereturn }}</div>
			  {% endif %}
			</div>
		</div>
		<div class="pts-form-group required">
			<label class="pts-col-sm-2 pts-control-label" for="input-storemetakeyword">{{ entry_storemetakeyword }}</label>
			<div class="pts-col-sm-10">
			   <textarea name="store_meta_keywords" class="pts-form-control" rows="5">{{ store_meta_keywords }}</textarea>
			  {% if error_storemetakeyword %}
			  <div class="text-danger">{{ error_storemetakeyword }}</div>
			  {% endif %}
			</div>
		</div>
		<div class="pts-form-group required">
			<label class="pts-col-sm-2 pts-control-label" for="input-storemetadescription">{{ entry_storemetadescription }}</label>
			<div class="pts-col-sm-10">
			   <textarea name="store_meta_description" class="pts-form-control" rows="5">{{ store_meta_description }}</textarea>
			  {% if error_storemetadescription %}
			  <div class="text-danger">{{ error_storemetadescription }}</div>
			  {% endif %}
			</div>
		</div>
		<div class="pts-form-group required">
			<label class="pts-col-sm-2 pts-control-label" for="input-storebankdetail">{{ entry_storebankdetail }}</label>
			<div class="pts-col-sm-10">
			   <textarea name="store_bank_details" class="pts-form-control" rows="5">{{ store_bank_details }}</textarea>
			  {% if error_storebankdetail %}
			  <div class="text-danger">{{ error_storebankdetail }}</div>
			  {% endif %}
			</div>
		</div>
		<div class="pts-form-group">
			<label class="pts-col-sm-2 pts-control-label" for="input-storetin">{{ entry_storetin }}</label>
			<div class="pts-col-sm-10">
			  <input type="text" name="store_tin" value="{{ store_tin }}" placeholder="" id="input-storetin" class="pts-form-control" />
			  {% if error_storetin %}
			  <div class="text-danger">{{ error_storetin }}</div>
			  {% endif %}
			</div>
		</div>
		<div class="pts-form-group">
			<label class="pts-col-sm-2 pts-control-label" for="input-storeshipping">{{ entry_storeshipping }}</label>
			<div class="pts-col-sm-10">
			  <input type="text" name="store_shipping_charge" value="{{ store_shipping_charge }}" placeholder="{{ entry_storeshipping }}" id="input-storeshipping" class="pts-form-control" />
			  {% if error_storecharge %}
			  <div class="text-danger">{{ error_storecharge }}</div>
			  {% endif %}
			</div>
		</div>
		<div class="pts-form-group required">
			<label class="pts-col-sm-2 pts-control-label" for="input-storeshipping">{{ entry_storeseo }}</label>
			<div class="pts-col-sm-10">
			  <input type="text" name="store_seo" value="{{ store_seo }}" placeholder="{{ entry_storeseo }}" id="input-storeseo" class="pts-form-control" />
			  {% if error_storeseo %}
			  <div class="text-danger">{{ error_storeseo }}</div>
			 {% endif %}
			</div>
		</div>
        </fieldset>
        <div class="buttons clearfix">
          <div class="pts-pull-left"><a href="{{ back }}" class="pts-btn pts-btn-default">{{ button_back }}</a></div>
          <div class="pts-pull-right">
            <input type="submit" value="{{ button_continue }}" class="pts-btn pts-btn-primary" />
          </div>
        </div>
      </form>
      {{ content_bottom }}</div>
    {{ column_right }}</div>
</div>
<link href="admin/view/javascript/codemirror/lib/codemirror.css" rel="stylesheet" />
  <link href="admin/view/javascript/codemirror/theme/monokai.css" rel="stylesheet" />
  <script type="text/javascript" src="admin/view/javascript/codemirror/lib/codemirror.js"></script> 
  <script type="text/javascript" src="admin/view/javascript/codemirror/lib/xml.js"></script> 
  <script type="text/javascript" src="admin/view/javascript/codemirror/lib/formatting.js"></script> 
  <script type="text/javascript" src="catalog/view/javascript/purpletree/summernote/summernote.js"></script>
  <link href="catalog/view/javascript/purpletree/summernote/summernote.css" rel="stylesheet" />
  <script type="text/javascript" src="catalog/view/javascript/purpletree/summernote/summernote-image-attributes.js"></script> 
  <script type="text/javascript" src="catalog/view/javascript/purpletree/summernote/opencart.js"></script> 
 <script type="text/javascript"><!--
function country(element,zone_id) { 
	$.ajax({
		url: 'index.php?route=account/account/country&country_id=' + element.value,
		dataType: 'json',
		beforeSend: function() {
			$('select[name=\'store_country\']').after(' <i class="fa fa-circle-o-notch fa-spin"></i>');
		},
		complete: function() {
			$('.fa-spin').remove();
		},
		success: function(json) {
			if (json['postcode_required'] == '1') {
				$('input[name=\'store_zipcode]\']').parent().parent().addClass('required');
			} else {
				$('input[name=\'store_zipcode\']').parent().parent().removeClass('required');
			}

			html = '<option value="">{{ text_select }}</option>';

			if (json['zone'] && json['zone'] != '') {
				for (i = 0; i < json['zone'].length; i++) {
					html += '<option value="' + json['zone'][i]['zone_id'] + '"';

					if (json['zone'][i]['zone_id'] == zone_id) {
						html += ' selected="selected"';
					}

					html += '>' + json['zone'][i]['name'] + '</option>';
				}
			} else {
				html += '<option value="0">{{ text_none }}</option>';
			}

			$('select[name=\'store_state\']').html(html);
		},
		error: function(xhr, ajaxOptions, thrownError) {
			alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
		}
	});
}

$('select[name$=\'store_country\']').trigger('change');
//--></script>
{{ footer }}