{* @compiler:inline-only *}
{if $body.products and $body.stepName != 'cart'}
   {split_partner_products products=$body.products assign=productGroups}
   {* $productGroups contains array ['native' => $products, 'partner' => $products] *}

   {if count($productGroups.partner) && count($productGroups.native)}
      <div class="alert alert-warning" role="warning">
         <p>{t}POZOR - Vaše objednávka bude rozdělena do dvou balíků, které vám budou doručeny samostatně{/t}</p>
      </div>
   {/if}

   <div class="order-products order-products-summary{if $body.products|count > 5} custom-scrollbar{/if}">
      {if count($productGroups.partner) && count($productGroups.native)}
         <div class="w-text" style="margin-bottom:-5px">
            <p>{t}1. balík obsahuje:{/t}</p>
         </div>
      {/if}
      {foreach $productGroups as $groupName => $groupProducts}
         {if $groupName == 'partner' && count($groupProducts) && count($productGroups.native)}
            {* partnerske produkty jsou vzdy druhe v poradi => obsah nize se vykresli pouze pokud existuji oba typy produktu *}
            <div class="w-text small-text m-t-2" style="margin-top:1rem;margin-bottom:-5px">
               <p>{t}2. balík obsahuje:{/t}</p>
            </div>
         {/if}
         {foreach $groupProducts as $product}
            <div class="product">
               <div class="image img-overlay">
                  <a href="{url s=product IDproduct=$product.id}" title="{t}Zobrazit zboží{/t}">
                     {$photo_dimensions = $cfg.Photo.types['product_cart'].size}
                     <img src="{get_photo photo=$product.image size='product_cart'}" alt="{$product.title}"
                          class="img-responsive" width="{$photo_dimensions[0]}" height="{$photo_dimensions[1]}">
                  </a>
               </div>
               <div class="title">
                  {block 'title'}
                     <a href="{url s=product IDproduct=$product.id TITLE=$product.title}"
                        title="{t}Zobrazit produkt{/t}">
                        <strong>{$product.product.descr|default:$product.product.model_section} {$product.product.model_short_title}</strong>
                        {if !$product.product.set}{$product.title|replace:$product.product.model_short_title:''}{else}{t}Kazeta{/t} {$product.product.set}{/if}
                     </a>
                     {if $product.product and $product.note}
                        <span class="variation">{$product.product->printNote($product.note)}</span>
                     {/if}
                     {ifmodule PRODUCTS_CHARGES}
                     {if $product.product}
                        {if $charges = $product.product->fetchCharges()}
                           {foreach $charges as $charge}
                              {if $product.note.charges[$charge.id] == 'Y'}
                                 <span class="variation">+ {$charge.title} ({$charge.price|format_price})</span>
                              {/if}
                           {/foreach}
                        {/if}
                     {/if}
                     {/ifmodule}
                  {/block}
               </div>
               <div class="price">
                  {block "summary-product-price"}
                     <small>{$product.pieces}&nbsp;{t}ks{/t}</small>
                     <strong>{$product.totalPrice.value_with_vat|format_price}</strong>
                  {/block}
               </div>
            </div>
         {/foreach}
      {/foreach}

      {include "ordering/ordering.summary.gift.tpl"}
   </div>
{/if}
