{* @compiler:inline-only *}
{if $item.product}
   {if $charges = $item.product->fetchCharges()}
      <div class="cart-product-charges">
         {foreach $charges as $charge}
            {if $charge.figure == 'N'}{continue}{/if}
            {if $isCart}
               <label class="charge-item custom-control custom-checkbox {if $charge.required == "Y"}disabled{/if}">
                  <input type="hidden" name="products[{$product.idincart}][note][charges][{$charge.id}]" value="N">
                  <input type="checkbox" name="products[{$product.idincart}][note][charges][{$charge.id}]" value="Y" class="custom-control-input" data-charge-input
                         {if $item.note.charges[$charge.id] == 'Y'}checked{/if}>
                  <span class="custom-control-indicator"></span>
                  {if $charge.product}
                     {get_photos type='products' id=$charge.product.id assign='product_photos'}
                     <span class="charge-title">+</span>
                     <a class="charge-product" href="{url s=product IDproduct=$charge.product.id TITLE=$charge.product.title}">
                        <div class="img">
                           <img src="{get_photo photo=$product_photos[0] size='product_cart'}"
                                alt="{$charge.product.title}" width="{$cfg.Photo.types.product_cart.size[0]}"
                                height="{$cfg.Photo.types.product_cart.size[1]}" class="img-responsive">
                        </div>
                        {block "charge-product-title"}
                           <span class="product-title">{$charge.product.title}</span>
                        {/block}
                     </a>
                  {else}
                     <span class="charge-title">{$charge.title|default:$charge.admin_title}</span>
                  {/if}
                  <strong class="charge-price">{$charge.price|format_price}</strong>
                  {if $charge.descr}
                     <i class="fc icons_tooltip charge-tooltip">
                        <span class="wpj-tooltip">{$charge.descr|strip_tags}</span>
                     </i>
                  {/if}
               </label>
            {elseif $item.note.charges[$charge.id] == 'Y'}
               <p class="charge-item">
                  <span>
                     {$charge.title|default:$charge.admin_title}{if $item.note.charges_notes[$charge.id]}: <strong>{$item.note.charges_notes[$charge.id]}</strong>{/if}
                     <span class="charge-price">
                        {$charge.price->getPriceWithVat()|format_price}
                     </span>
                  </span>

                  {if !$hideDelete}
                     <a href="{url s=cart}?act=recount&products[{$item.id}][note][charges][{$charge.id}]=N" class="fc icons_trash delete-charge" data-cart="charge-delete"></a>
                  {/if}
               </p>
            {/if}
         {/foreach}
      </div>
   {/if}
{/if}
