{assign var="productForm" value="Product"} 
<div class="clearfix option productOptionRow margin-top" > 
                    <h3 class="single-option border-bottom margin-bottom">
                        <a class="op-delete deleteRow icon-close-narrow"  title="{$language.lblDeleted}" href="javascript:void(0);" rel="productOptionsGroup_{$productOptionCount}_is_delete" id="{$productOptionCount}"></a>
                        <span> {$language.lblOption}{$productOptionCount} </span></h3>
<div class="productOptionRow-details">
     {form->hidden 	name			= "productOptionsGroup[{$productOptionCount}][option_id]" 
    				value			= "-1"} 
	{form->hidden 	name			= "productOptionsGroup[{$productOptionCount}][is_delete]" 
    				class			= "multioptiondelete"
                    value			= "0"}
     {form->hidden 	name			= "productOptionsGroup[{$productOptionCount}][realOptionCount]"     				
                    value			= $productOptionCount} 
                    
         {form->hidden 	name			= "productOptionsGroup[{$productOptionCount}][productOptionImageSort]"}     
               
                 <div class="form-group row single-option">
                 
                   
                 
                   <label class="col-sm-4 col-md-3">
                     {$language.lblOptionName}
                    </label>

                    <div class="col-sm-7 col-md-6 col-lg-5 ">
                     <ul class="levl-01">
                  		 <li class="clearfix single-option">
                 
                    
                    <div class="right1 ">
                     <ul class="levl-01">
                  		<li class="clearfix first">
		    {form->textbox 	name			= "productOptionsGroup[{$productOptionCount}][productOptionName]" 
		    error_class		= "message_inline_validation"
		    size			= "25" 
		    class			= "form-control productName" 
		    form			= $productForm 
		    validate_inline	= "yes" 
		    maxlength		= "255" 
		    rel				= "productOptionsGroup_{$productOptionCount}_is_delete"  
		    fieldName		= "productOptionName" 
		    group			= "productOptionsGroup"
		    row				= $productOptionCount}
                                   
                    </li>
                    </ul>
                    </div>
                  </li>
             
                    </ul>
                    </div>
                    
                  </div>
                  
		  <div class="form-group row">                 
                    <label class="col-sm-4 col-md-3"> 
                     {$language.lblSKU}
                    </label>
                    <div class="col-sm-7 col-md-6 col-lg-5 ">
                                            
		    {form->textbox  error_class		= "message_inline_validation" 
		    size			= "25" 
		    name			= "productOptionsGroup[{$productOptionCount}][optionSKU]" 
		    class			= "form-control"
		    form			= $productForm 
		    maxlength		= "255"
		    validate_inline	= "yes" 
		    rel	= $productOptionCount  
		    fieldName		= "optionSKU" 
		    group			= "productOptionsGroup"
		    row				= $productOptionCount} 
                </div>
                  </div>
		   <div class="form-group row">                 
                    <label class="col-sm-4 col-md-3">
                      {$language.lblBarCode} <span class="sub-text">[UPC,ISBN]</span> 
                    </label>
                    <div class="col-sm-7 col-md-6 col-lg-5 ">
                                
		{form->textbox  
			size			= "25" 
                        name			= "productOptionsGroup[{$productOptionCount}][optionBarCode]" 
                        class			= "form-control"
                        form			= $productForm  
                        value			= $productOptions.optionBarCode|default:''|unescape
                        maxlength		= "255"
                        rel				= $productOptionCount
                        fieldName		= "optionBarCode" 
			group			= "productOptionsGroup"
                        row				= $productOptionCount} 
                     </div>
                  </div>
                 <div class="form-group row">                 
                    <label class="col-sm-4 col-md-3">{$language.lblPrice}</label>
                    <div class="col-sm-7 col-md-6 col-lg-5 ">
                        <div class="row">
                            <div class="col-xs-6">
                    	<label class="label mandatory">{$language.lblItemPrice}</label>
		    {form->textbox 	name= "productOptionsGroup[{$productOptionCount}][productOptionRegularPrice]"
    				error_class		= "message_inline_validation"   
                    form			= $productForm 
                    validate_inline	= "yes" 
                    class			= "form-control" 
                    maxlength		= "11" 
                    rel				= $productOptionCount 
                    fieldName		= "productOptionRegularPrice" 
		    group			= "productOptionsGroup"
                    row				= $productOptionCount}
                            </div>
                             <div class="col-xs-6">
                        <label class="label">{$language.lblSaleprice}</label>
		    {form->textbox 	name			= "productOptionsGroup[{$productOptionCount}][productOptionProductPrice]"    
    		    error_class		= "message_inline_validation" 
                    form			= $productForm 
                    validate_inline	= "yes" 
                    class			= "form-control" 
                    rel				= $productOptionCount maxlength="11" 
                    fieldName		= "productOptionProductPrice" 
		    group			= "productOptionsGroup"
                    row				= $productOptionCount}
                            </div>
                        </div>
                    </div>
                  </div>      

				<div class="form-group row " >
                    <label class="col-md-3">{$language.lblGroupPrice}</label>
                    <div class="col-md-7 col-lg-6 ">
							
                            <div id="group_prices_table" >
                    <div class="header clearfix">
                    <div class="col-xs-6 field rmv-padding"><label>{$language.lblCustomerGroup}</label></div>
                    <div class="col-xs-5 rmv-padding"><label>{$language.lblPrice}</label></div>
                    </div>
                    <div class=" clearfix" id="group_price_container_{$productOptionCount}">
                        
								     {if $productOptions['group_price']|default:array()|count|default:0>0}
                                     {foreach $productOptions['group_price']|default:'' as $key=>$group_price}
                                     <div class="clearfix parent">
                        <div class="col-xs-6 field rmv-padding">
		   {form->select options="{$listUsergroups|default:''}" 
				value="{$group_price['userGroupID']|default:''}"
				rel="{$productOptionCount}_{$key}"
				productOptionCount="{$productOptionCount}"
				name="productOptionsGroup[{$productOptionCount}][group_price][{$key}][userGroupID]"  
				class="form-control "}
				<span class="message_validation grp_{$productOptionCount}_{$key} hide"><span>{$language.errDuplicateCombination}</span></span>
		    </div> 
			
                    <div class="col-xs-5 rmv-padding">
		  {form->textbox 
				class="form-control  {$productOptionCount}_{$key} form-control required-entry validate-zero-or-greater"
				validate="callback_usergroupprice"
				value={$group_price['specialPrice']|default:''|price_no_symbol}
				error="Required"
				name="productOptionsGroup[{$productOptionCount}][group_price][{$key}][specialPrice]" 
				}
		    </div>
            <div> {html->anchor class="icon-close txt-hide" id="group_price_row_1_delete_button"  title="{$language.lblDelete}" onclick="return groupPriceControl.deleteItem($(this));"}</div>
           
            </div>
            {/foreach}
             {/if}
            </div>
            <div>
            {html->anchor  class="btn btn-primary btn-small" id="id_{$productOptionCount}" content="<span class='icon-plus2'></span>{$language.lblAddGroupPrice}" title="{$language.lblAddGroupPrice}" onclick="return groupPriceControl.addItem('{$productOptionCount}','productOptionsGroup','option_')"}
            </div>
							</div>
                    

                    </div>
                  </div>
				  
				  <div class="form-group row">
                    <label class="col-md-3">{$language.lblTierPrice}</label>
                    <div class="col-md-9">
                    
                    <div id="tiers_table">
                    <div class="header clearfix">
                    <div class="col-xs-4 field rmv-padding"><label>{$language.lblCustomerGroup}</label></div>
                    <div class="col-xs-4 field rmv-padding"><label>{$language.lblQty}</label></div>
                    <div class="col-xs-3 rmv-padding"><label>{$language.lblPrice}</label></div>
                        
                        
                        </div>
                    <div class="levl-02 clearfix" id="tier_price_container_{$productOptionCount}">
                                    {foreach $productOptions['tier_price']|default:array() as $key=>$tier_price}
                                     <div class="clearfix parent">
                         <div class="col-xs-4 field rmv-padding">
						 {assign var="userGroupID" value="{$tier_price['userGroupID']|default:''}"}
							{if $tier_price['allGroups']|default:''==1}
								{assign var="userGroupID" value=""}
							{/if}
		   {form->select 
				options="{$listUsergroups|default:''}" 
				caption="->{$language.lblAllGroups}"
				value="{$userGroupID|default:''}"
				rel="{$productOptionCount}_{$key}"
				productOptionCount="{$productOptionCount}"
				name="productOptionsGroup[{$productOptionCount}][tier_price][{$key}][userGroupID]"  
				class="option_tier_price_user_group form-control custgroup "}
				<span class="message_validation  tier_{$productOptionCount}_{$key} hide"><span>{$language.errDuplicateCombination}</span></span>
		    </div>
            <div class="col-xs-4 field rmv-padding">
			<small class="hidden-xs">{$language.lblandabove}</small>
		   {form->textbox 
											class="option_tier_price_qty {$productOptionCount}_{$key} tier-qty form-control required-entry"
											validate="callback_tierprice_quantity"
											value="{$tier_price['quantity']|default:''}"
											error="Required"
											name="productOptionsGroup[{$productOptionCount}][tier_price][{$key}][quantity]"
											}
										
		    </div>
			
                    <div class="col-xs-3 rmv-padding">
		 {form->textbox 
											class="option_tier_price_tier_price {$productOptionCount}_{$key} form-control required-entry "
											validate="callback_tierprice_price"
											value="{$tier_price['tierPrice']|default:''|price_no_symbol}"
											error="Required"
											name="productOptionsGroup[{$productOptionCount}][tier_price][{$key}][tierPrice]" 
											}
		    </div>
            <div>{html->anchor  class="icon-close txt-hide" id="tier_price_row_{$key}_delete_button"  title="{$language.lblDelete}" onclick="return tierPriceControl.deleteItem($(this));"}
									</div>
           
            </div>
            {/foreach}
            </div>
            <div>
             {html->anchor  class="btn-primary btn-small btn" id="id_{$productOptionCount}" content="<span class='icon-plus2'></span>{$language.lblAddTier}" title="{$language.lblAddTier}" onclick="return tierPriceControl.addItem('{$productOptionCount}','productOptionsGroup','option_')"}
            </div>
							</div>
                   
                    </div>
                  </div>
	

				  
                      <div class="form-group row">
                    <label class="col-sm-4 col-md-3">{$language.lblQuantity}</label>
                    <div class="col-sm-7 col-md-6 col-lg-5">
                  {form->textbox 	name= "productOptionsGroup[{$productOptionCount}][productOptionQuantity]"
    				class			= "form-control" 
                    error_class		= "message_inline_validation" 
                    form			= $productForm 
                    validate_inline	= "yes" 
                    rel				= $productOptionCount 
                    maxlength		= "9" 
                    fieldName		= "productOptionQuantity" 
		    group			= "productOptionsGroup"
                    row				= $productOptionCount} 
                                   
                    </div>
                  </div>                                                        
                  <div class="form-group row">
                      <label class="col-sm-4 col-md-3">{$language.lblPackage}</label>
                      <div class="col-sm-7 col-md-6 col-lg-5">
                      <div class="row">
                        <div class="col-xs-3">
                            <label class="label1">{$language.lblWeight}</label> 
                            {form->textbox 	name= "productOptionsGroup[{$productOptionCount}][packageWeight]"
    				class			= "form-control" 
                    error_class		= "message_inline_validation" 
                    form			= $productForm 
                    rel				= $productOptionCount
                    validate_inline	= "yes"
                    group			= "productOptionsGroup"
                    fieldName		= "packageWeight" 
                    row				= $productOptionCount}</div>
                          
		              <div class="col-xs-3">
                <label class="label1">{$language.lblLength} </label>
                           
                           {form->textbox 	name			= "productOptionsGroup[{$productOptionCount}][packageLength]"
    				class			= "form-control" 
                    error_class		= "message_inline_validation" 
                    form			= $productForm 
                    group			= "productOptionsGroup"
                    validate_inline	= "yes"
                    rel				= $productOptionCount                    
                    fieldName		= "packageLength" 
                    row				= $productOptionCount}</div>
                         <div class="col-xs-3">
                             <label class="label1">{$language.lblWidth}</label>
                         {form->textbox 	name			= "productOptionsGroup[{$productOptionCount}][packageWidth]"
    				class			= "form-control" 
                    error_class		= "message_inline_validation" 
                    form			= $productForm 
                    rel				= $productOptionCount 
                    validate_inline	= "yes"
                    group			= "productOptionsGroup"                 
                    maxlength		= "9" 
                    fieldName		= "packageWidth" 
                    row				= $productOptionCount}
                         </div>
                          <div class="col-xs-3">
                              <label class="label1">{$language.lblHeight}</label>
                         {form->textbox 	name			= "productOptionsGroup[{$productOptionCount}][packageHeight]"
    				class			= "form-control" 
                    error_class		= "message_inline_validation" 
                    form			= $productForm 
                    group			= "productOptionsGroup"
                    validate_inline	= "yes"
                    rel				= $productOptionCount 
                    value=$productOptions.packageHeight|default:'' 
                  
                    fieldName		= "packageHeight" 
                    row				= $productOptionCount}</div>
                           
                             
                        	
                        </div>
                      
                        
                      </div>
                    </div>
                 
                      <div class="single-option form-group row">
                   <label class="col-sm-4 col-md-3">&nbsp;</label>
                    <div class="col-sm-7 col-md-6 col-lg-5">                                        
                      {form->radio 	name= "productOptionsGroup[{$productOptionCount}][defaultOpion]"  
    				   options		= "Yes->{$language.lblsetDefaultproductoption}" value="Yes"
                       rel			= $productOptionCount 
                       group			= "productOptionsGroup"
                       class        = "defaultOpion"
                       row				= $productOptionCount
                       fieldName		= "defaultOpion" 
                    }
                     </div>
                  </div>
                  <div class=" form-group row single-option">
                    <label class="col-sm-4 col-md-3">{$language.lblOptionStatus}</label>
                      <div id="pedioddiv">
                   <div class="col-sm-7 col-md-6 col-lg-5 custom-radio"> 
                    {form->radio 	name= "productOptionsGroup[{$productOptionCount}][productOptionStatus]"  
    				  options			= "Active->{$language.lblActive}~*Inactive->{$language.lblInactive}" class="customradio" value="Active"}
                    
                    </div>
                          </div>
                  </div> 
                    <div class="info-head"><h3 class="border-bottom">{$language.lblAdditionalImages}</h3></div>
                  <div class="form-group row">
                    <label class="col-sm-4 col-md-3">{$language.lblImages}</label>
                    <div class="col-sm-8 col-md-9 image-upload">
                    <div class="clearfix">
					<p class="top-spc">
						{$language.lblThumbImageMsg}<br/>
						{$language.lblMaximumFileSize} {$FILE_UPLOAD_LIMIT}, {$language.lblFileTypes} {$VALID_IMAGE_FILES}
						</p>
                    <ul class="img-list clearfix " id="productImagesul{$productOptionCount}" rel="{$productOptionCount}">
                    {assign var="productImageCount" value=1}
		    
		    <li class="productImageInlineli{$productImageCount} productImageLi{$productOptionCount}" id="{$productImageCount}">
             {html->anchor class=" icon-close " title="{$language.lblDeleted}" onclick="deleteRowImages('{$productOptionCount}','{$productImageCount}')"}
   <span class="pull-left upload-column clearfix">	<p>{$language.lblMainImage} </p>      
    {form->upload_image message_delete="{$language.lblmsgdeleteImg}" delete_title="{$language.lblDelete}" name="productOptionImage_"|cat:$productOptionCount|cat:"_"|cat:$productImageCount validate="isImage" error=$language.errValidImage } 
    </span>    
                  <span class=" upload-column clearfix"><span class="show" id="thumbLink_{$productOptionCount}_{$productImageCount}" ><a href="javascript:void(0);" class="btn btn-default btn-small" onclick="showThumbImages('{$productOptionCount}','{$productImageCount}')">
		  {$language.Uploadthumbimage}</a></span> 
                  <span class="hide" id="thumbBlock_{$productOptionCount}_{$productImageCount}"><p>{$language.lblThumbImage}</p> 
  {form->upload_image message_delete="{$language.lblmsgdeleteImg}" delete_title="{$language.lblDelete}" validate="isImage" error=$language.errValidImage  name="productOptionImageThumb_"|cat:$productOptionCount|cat:"_"|cat:$productImageCount width="120"} 
  
  </span>
 </span>
</li>
 <li class="addimg-bx" id="upload-btn{$productOptionCount}">   <a class="btn btn-primary btn-small add_option_images" title="Add Image" id="{$productOptionCount}"><span class="icon-plus2"></span>{$language.lblAddImages}</a> </li>  
		    
     		    {form->hidden name="productOptionImageCount"|cat:$productOptionCount value=$productImageCount}
                    </ul>
                    </div>
                    
                     </div>
                     
                  </div>                 
                </div>
                </div>
              </div>

{form->validate_inline_script form=$productForm}
<script type="text/javascript">
$('.img-list').sortable({		
		items: "> li",		
		update: function(event, ui) {
			var result = $(this).sortable('toArray');						 
			$("#productOptionsGroup_"+$(this).attr('rel')+"_productOptionImageSort").val(result);
			}
	});
	</script> 
