<div class="rightBx wth-bdr" >

    <div class="px-2 pt-2 pb-3">
    {html->anchor href="cart/" class="btn btn-link btn-sm float-right font-rglr" content="<span class='icon-edit-fill'></span> {$language.lbleditCart}"}
        <h3 class=" h5  font-rglr orderHead collapsed m-0" data-toggle="collapse" data-target="#collapseExample">
	  	<span class="d-inline-block d-lg-none pr-md-3 icon-add font-small"></span>
	  	{$language.lblOrderSummary}
  	</h3>
    </div>
    
    <div class="collapse d-lg-block" id="collapseExample">
  <div class="orderSumry">
	  <div id="bx_cart_bx" >
      <div class="order-head clearfix border-top border-bottom py-2 px-3 bg-light h6 font-rglr">
        <div class="float-left font-semibold">{$language.lblpdtDetailPrice}</div>
        <div class="float-right font-semibold mr-2">{$language.lblQuantity}</div>

      </div>
    <ul class="p-2 p-md-3 border-bottom">
      {assign var="taxDescription" value=""}  
      {foreach from=$cartData['items'] item="cartItem"}
      <li class="clearfix"> 
      {assign var="titleClass" value="title"}
      {if $settingsTaxApplicable eq 'Yes' && $cartItem.itemDetails.orderItemTaxDescription neq ''} 		
        {assign var="taxDescription" value="{$cartItem.itemDetails.orderItemTaxDescription}"}
      {/if}
        <figure class="float-left border">
            <img src="{$view_public_path}/uploads/catalog/product/small/{$cartItem.itemDetails.imagePath}" class="img-fluid" alt="image">
        </figure>
        <figcaption>
              <span class="float-right mr-2 qty-section text-right">{$cartItem.orderItemQuantity}</span>  <br>
              {if $cartItem.sellAsBatch eq 'Yes'} 
                    <span class="font-small text-dark font-medium d-none d-lg-block">{$language.lblSetof} {$cartItem.qtyPerBatch} {$cartItem.batchType} - {$cartItem.orderItemPrice|price:Full:$cartData.currencyID:$cartData.userCurrencyID}</span> 
                    <span class="font-small text-dark font-medium d-none d-lg-block">{$language.lblper} {$cartItem.batchType} - {($cartItem.orderItemPrice/$cartItem.qtyPerBatch)|price:Full:$cartData.currencyID:$cartData.userCurrencyID}</span> 
                    
                {/if}
              {html->anchor href=$cartItem.itemDetails.productURL|cat:"?configid="|cat:$cartItem.cartItemID 
			title={$cartItem.itemDetails.productOptionName|unescape:"html"} content={$cartItem.itemDetails.productOptionName|unescape:"html"} class=$titleClass}
            <br>
	  <span class="price h6 font-rglr">{$cartItem.itemDetails.unitPrice|price:'Full':$cartData.currencyID:$cartData.userCurrencyID}</span><br />
		{if $cartItem.itemDetails.combinationValues.customOption|count|default:0 >0}
			<div class="cart-detil pt-3">
				<span class="heading">{$language.lblCombinationSKU} - {$cartItem.itemDetails.combinationValues.cimbinationSKU}</span>
				<div class="fade-text">
					<span class="combination">
						{foreach from=$cartItem.itemDetails.combinationValues.customOption item="combination" key="key"}
							{if $key neq 0}<span class="x-style"> | </span>{/if}
							{$combination.customOptionName}{$combination.variantValue}
						{/foreach}
					</span>
				</div>
			</div>
		{/if}
		{if $cartItem.itemDetails.customOptionValues|count >0}
			<div class="cart-detil pt-3"><span class="heading">Options</span>
				<div class="fade-text">
					{foreach from=$cartItem.itemDetails.customOptionValues item="customOptionValues"}
						<span class="combination clearfix" >
                            <span class="left">{$customOptionValues.0.customOptionName}</span>
                            <span class="right">
                            {foreach from=$customOptionValues item="customOption" key="key"}
                                {if $customOption.inputType != 'file'}
                                    {$customOption.variantValue}{if $key >0},{/if}
                                {else if $customOption.inputType == 'file' && $customOption.variantValue!=''}
                                    {html->anchor href="/cart/getFile/id/{$customOption.variantValue}/" 
                                    caption=$customOption.variantValue 
                                    title=$customOption.customOptionName}
                                {/if}
                            {/foreach}
                            </span>
						</span>
					{/foreach}
				</div>
			</div>
		{/if}
          </figcaption>
			
		</li>
      {/foreach}
        </ul>
      </div>

  </div>
  <ul class="simple-listing03-summary pt-3 px-3 pb-0 " id="bx_cart_bx2">
        <li>
    <ul class="promo mb-3 row ">
		{if $enablePromoCode eq 'Yes'}
		<li class="first odd items pb-2 col-12 col-sm-6 col-md-5 col-lg-12">
            {if $cartData.orderPromoCode eq ''}
            <div class="input-group mb-3">
             {form->textbox name="promoCode" class="form-control" value="" placeholder=$language.lblPromoCode autocomplete="off"}
              <div class="input-group-append">
                {form->button name="applypromo" class="btn btn-secondary btn-md" id="applypromo" value=$language.lblApply}
              </div>
            </div>
			{else}
			<div class="input-group mb-3">
             <span class=" form-control">{$cartData.orderPromoCode}</span>
              <div class="input-group-append">
                {if $cartData.promoID gt 0}
			{html->anchor id="removepromo" class="btn btn-outline-secondary " caption="{$language.lblChangeOrRemove}"}
			{/if}
              </div>
            </div>
		{/if} 
        </li>
		{/if}

		  
				
		{if $settingsEnableGiftCoupon eq "Yes" && $userID|default:'' !=''}

		<li class="col-12 col-sm-6 col-md-5 col-lg-12 pb-1">
             {if $userID !=''} 
                {form->start name="formRedeemCoupon" method="post" onsubmit="return false;"}   
                {else}
                {form->start name="formRedeemCoupon" action="" method="post"}
                {/if}
            <div class="input-group mb-3">
                {if $userID !=''}
            {form->textbox name="couponCode" class="form-control " validate="required" error=$language.errCouponCode placeholder=$language.lblGiftCouponCode}
                {/if}
              <div class="input-group-append">
                  {form->hidden name="pageCart" value="1"}
					{form->hidden name="cartUser" value=$userID}
                  {form->submit name="submitCoupon" value="{$language.lblRedeem}" class="go-btn btn btn-secondary "}
				
              </div>
            </div>
			{form->close}
			</li> 
			{/if}
		</ul>
    </li>

    <li class="clearfix pb-1">
      <div class="value float-right ml-1" >{$cartData.orderSubtotal|price:'Full':$cartData.currencyID:$cartData.userCurrencyID}</div>
      <label class="float-right">{$cartData.orderQty} {$language.lblCartItems} : </label>

    </li>
    {if $cartData.shippingAmount>0}

    <li class="clearfix pb-1">
      <div class="value float-right ml-1" >{$cartData.shippingAmount|price:'Full':$cartData.currencyID:$cartData.userCurrencyID}</div>
            <label class="float-right">{$language.lblShippingCharge} : </label>

    </li>
    {/if}  
	{if $enableApplyAfterDiscount|default:'' neq 'Yes'}  
		{if $cartData.orderPromoDiscountAmount>0}

		<li class="clearfix pb-1">
		  <div class="value float-right ml-1" >-{$cartData.orderPromoDiscountAmount|price:'Full':$cartData.currencyID:$cartData.userCurrencyID}</div>
		  		  <label class="float-right">{$language.lblPromoDiscount} : </label>

		</li>
		{/if}                          {if $cartData.orderOtherServiceCharge>0}

		<li class="clearfix pb-1">
		  <div class="value float-right ml-1" >{$cartData.orderOtherServiceCharge|price:'Full':$cartData.currencyID:$cartData.userCurrencyID}</div>
		  		  <label class="float-right">{$language.lblServiceCharge} : </label> 

		</li>
		
		{/if}  
		{if $cartData.orderConvenientFee>0}

            <li class="clearfix pb-1">
                <div class="value float-right ml-1" >{$cartData.orderConvenientFee|price:'Full':$cartData.currencyID:$cartData.userCurrencyID}</div>
				<label class="float-right">{$language.lblConvenientFee} : </label> 

            </li>
        {/if}
		{if $cartData.orderTaxAmount>0}

		<li class="clearfix pb-1">

		  <div class="value float-right ml-1" >{$cartData.orderTaxAmount|price:'Full':$cartData.currencyID:$cartData.userCurrencyID}</div>
		  		  <label class="float-right">{$language.lblTaxAmount}{if $taxDescription|default:'' neq ''} - {$taxDescription}{/if} : </label>

		</li>
		{/if}  
	{else}  
		{if $cartData.orderPromoDiscountAmount>0}

		<li class="clearfix pb-1">
		  <div class="value float-right ml-1" >-{$cartData.orderPromoDiscountAmount|price:'Full':$cartData.currencyID:$cartData.userCurrencyID}</div>
		  		  <label class="float-right">{$language.lblPromoDiscount} : </label>

		</li>
		{/if}  
		{if $cartData.orderTaxAmount>0}

		<li class="clearfix pb-1">

		  <div class="value float-right ml-1" >{$cartData.orderTaxAmount|price:'Full':$cartData.currencyID:$cartData.userCurrencyID}</div>
		  		  <label class="float-right">{$language.lblTaxAmount}{if $taxDescription|default:'' neq ''} - {$taxDescription}{/if} : </label>

		</li>
		{/if}  
		{if $cartData.orderOtherServiceCharge>0}

		<li class="clearfix pb-1">

		  <div class="value float-right ml-1" >{$cartData.orderOtherServiceCharge|price:'Full':$cartData.currencyID:$cartData.userCurrencyID}</div>
		  		  <label class="float-right">{$language.lblServiceCharge} : </label>

		</li>
		{/if} 
		{if $cartData.orderConvenientFee>0}

            <li class="clearfix pb-1">
  
                <div class="value float-right ml-1" >{$cartData.orderConvenientFee|price:'Full':$cartData.currencyID:$cartData.userCurrencyID}</div>
				<label class="float-right">{$language.lblConvenientFee} : </label> 

            </li>
        {/if}
	{/if}  
	{if $cartData.orderUserCreditAmount>0}

    <li class="clearfix pb-1">
      <div class="value float-right ml-1" >-{$cartData.orderUserCreditAmount|price:'Full':$cartData.currencyID:$cartData.userCurrencyID}</div>
            <label class="float-right">{$language.lblAccountCredit} : </label>

    </li>
    {/if}

	{if $cartData.redeemDiscountAmount > 0}
    <li class="clearfix pb-1">
      <div class="value float-right ml-1" >- {$cartData.redeemDiscountAmount|price:'Full':$cartData.currencyID:$cartData.userCurrencyID}</div>
            <label class="float-right">Redeemed Value : </label>

    </li>
    {/if}
 
  </ul>
        </div>
  <div class="simple-listing03-summary px-3 pt-2 pt-lg-0 total">
  <div class="clearfix font-bold total-values">
      {form->hidden name="totOrderAmount" value=$cartData.orderTotalAmount}
      <div class="float-right font-bold ml-1 value" > &nbsp;{$cartData.orderTotalAmount|price:'Full':$cartData.currencyID:$cartData.userCurrencyID} </div>
        <label class="float-right"> {$language.lblTotalAmount} : </label>
    </div>
  </div>
</div>
<script type="text/javascript">
	$(document).ready(function(){
		$('.icon-plus-narrow').click(function(){
			$(this).toggleClass('active');
			$('#bx_cart_bx,#bx_cart_bx2').slideToggle();
		})
		// $('.process ul li').click(function(){
		// 	$(this).toggleClass('active');
		// })
		
        
        if (window.matchMedia('(max-width: 768px)').matches) {
            $('.orderHead').click(function(){
                $(this).toggleClass('active');
                $('#bx_cart_bx,#bx_cart_bx2').slideToggle();
            })
        }
		
	});



</script>
