{form->start name="formCheckoutShipping" method="post" action="" formType="ajax_form"}
<ul id="AjaxdivShippingFields" class="content" style="display:none;">
<h3 class="d-block d-md-none h4 font-rglr mb-3">{$language.lblShippinginfo}</h3>   
  <li class="clearfix">
    <div class="form-group" id="divPayAddressList">
      <label>{$language.lblYourShippingAddressList}:</label>
	  	{assign var="addressList" value=""}
		{foreach $userAddressList as $userAddress}
	  		{assign var="address"  value=$userAddress.shippingFname|cat:"~*"|cat:$userAddress.shippingLname|cat:"~*"|cat:$userAddress.shippingAddress1|cat:"~*"|cat:$userAddress.shippingAddress2|cat:"~*"|cat:$userAddress.shippingCity|cat:"~*"|cat:$userAddress.shippingProvince|cat:"~*"|cat:$userAddress.shippingZip|cat:"~*"|cat:$userAddress.shippingPhone|cat:"~*"|cat:$userAddress.shippingStateID|cat:"~*"|cat:$userAddress.shippingCountryID|address_format:$languageIDs:', '}
			{assign var="addressList" value=$addressList|cat:$userAddress.userShippingID|cat:"->"|cat:$address|cat:"~*"}
		{/foreach}
	    {form->select class="form-control" onchange="formFillShippingAddress(this.value)" name="address" options="->"|cat:$language.lblSelect|cat:"~*"|cat:$addressList|cat:"-1->"|cat:$language.lblAddNewAddress} </div>
  </li>
  <li class="row">
    <div class="form-group col-sm-6 col-12" id="divPayShippingFName">
      <label>{$language.lblFirstName} <span class="mndty">*</span></label>
      {form->textbox name="shippingFname" class="form-control"  validate="required" error=$language.errFirstName maxlength="200" value=$shippingFirstName|default:''} </div>
    <div class="form-group col-sm-6 col-12" id="divPayShippingLName">
      <label>{$language.lblLastName} <span class="mndty">*</span></label>
      {form->textbox name="shippingLname" class="form-control"  validate="required" error=$language.errLastName maxlength="200" value=$shippingLastName|default:''} </div>
  </li>
  <li class="row">
    <div class="form-group col-sm-6 col-12" id="divPayShippingAddress">
      <label>{$language.lblAddress1} <span class="mndty">*</span></label>
      {form->textbox name="shippingAddress" class="form-control"  validate="required" error=$language.errShippingAddress maxlength="200"} 
      {form->hidden name="shippingAddress1" value=""}
    </div>      

      <div class="form-group col-sm-6 col-12" id="divPayShippingCountry">
      <label>{$language.lblCountry} <span class="mndty">*</span></label>
      {form->select class="form-control" name="shippingCountry" caption="{if $resListCountryOptions|default:''|count>1}->{$language.lblselecttext}{/if}" validate="required" error=$language.errCountry options=$resListCountryOptions}{form->hidden name="shippingCountryID" value=$shippingCountryID|default:''} </div>
</li>
{if $resListCountryOptions|default:''|count=="1"}
    {assign var="shippingCountryID" value=$resListCountryOptions[0]['countryID']}
{/if}

  <li class="row">    
    <div class="form-group col-sm-6 col-12" id="divPayShippingState">
      <label>{$language.lblStateProvince} <span class="mndty">*</span> </label>
      <span id="shippingStateInput"> {form->select  class="form-control" name="shippingState" options="->{$language.lblselecttext}" validate="shippingStateSelectedType->isequal->state~*required" error=$language.errState}
      {form->hidden name="hidStateError" value=$language.errState} </span> <span id="shippingStateProvinceInput"> {form->textbox  name="shippingProvince" maxlength="100" class="form-control" validate="shippingStateSelectedType->isequal->province~*required"  error=$language.errProvince}
      {form->hidden name="hidProvinceError" value=$language.errProvince} </span><span id="loadProcessImageShipping"></span> {form->hidden id="shippingStateSelectedType"  name="shippingStateSelectedType" value=$shippingStateSelectedType|default:''}{form->hidden name="shippingStateID" value=$shippingState|default:''} </div>
      <div class="form-group col-sm-6 col-12" id="divPayShippingCity">
      <label>{$language.lblCity} <span class="mndty">*</span></label>
      {form->textbox name="shippingCity" class="form-control" validate="required" error=$language.errCityName maxlength="50"} </div>
  </li>
  <li class="row">    
    <div class="form-group col-sm-6 col-12" id="divPayShippingZip">
      <label>{$language.lblZipPostalCode} </label>
      {form->textbox name="shippingZip" class="form-control"  maxlength="20"} </div>
      <div class="form-group col-sm-6 col-12" id="divPayShippingPhone">
      <label>{$language.lblContactPhone} <span class="mndty">*</span></label>
          <div class="row">
            <div class="col-3">
              {form->select class="form-control"  name="shipCountrycode" caption="{$language.lblselecttext}"  options=$resCountryCode value=$shipCountrycode }
              </div>
              <div class="col-9">
       {form->textbox name="shippingPhone" class="form-control" maxlength="10" validate="required" error=$language.errPhone} </div>
              
              </div>
          </div>

</li>

  <li class="clearfix">
    <div class="form-group" id="shipping_save_to_list">
        {form->checkbox name="shippingSaveToList" value="1"}
        <label for="shippingSaveToList">{$language.lblSaveAddressBook}</label>
      </div>
    </li>
   <li class="clearfix">
     <div class="form-group" >
      {form->button name="submitCheckoutShipping" value=$language.lblProceed class="btn btn-secondary btn-md proceedBtn"}
	  {form->button  name="submitCheckoutShippingLoader" style="display:none" disabled="disabled"  id="submitCheckoutShippingLoader" class="btn btn-md btn-secondary buttonDisable" value="{$language.lblProceed}"}
	</div>
  </li>	
</ul>
{form->close}
{form->validate_script form="formCheckoutShipping"}