{* @compiler:inline-only *}
{if $body.products}
   {ifmodule PRODUCT_GIFTS}
   {$body.productList->fetchGifts()}
   {/ifmodule}
   <div class="order-products order-products-summary">
      {foreach $body.products as $product}
         <div class="product">
            <div class="image">
               <a href="{url s=product IDproduct=$product.id TITLE=$product.title}"
                  title="{t}Zobrazit produkt{/t}">
                  {block 'image'}
                     <img src="{get_photo photo=$product.image size=4}" alt="{$product.title}"
                          class="img-responsive">
                  {/block}
               </a>
            </div>
            <div class="title">
               {block 'title'}
                  <a href="{url s=product IDproduct=$product.id TITLE=$product.title}{if $product.id_variation}#{$product.id_variation}{/if}"
                     title="{t}Zobrazit produkt{/t}">{$product.product.title}</a>
                  {if $product.id_variation}
                     <span class="variation">{$product.product.variationTitle}</span>
                  {/if}

                  {if $product.product and $product.note}
                     <span class="variation">{$product.product->printNote($product.note)}</span>
                  {/if}
               {block "product-inline-addons"}
                     {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|default:$charge.admin_title} ({$charge.price|format_price:"ceil=no;decimal=dynamic"})</span>
                              {/if}
                           {/foreach}
                        {/if}
                     {/if}
                     {/ifmodule}

                     {ifmodule PRODUCT_GIFTS}
                     {foreach $product.product.gifts as $gift_product}
                        {if !$product.note.gifts[$gift_product.id].unwanted}
                           <span class="variation">+ {t}dárek{/t} {$gift_product.title}</span>
                        {/if}
                     {/foreach}
                     {/ifmodule}
                  {/block}
               {/block}
            </div>
            <div class="price-summary">
               {block 'price-total'}
                  {if $tpl_vars.ordering_products_discount}
                      {calc_product_discount product=$product.product assign='product_discount'}
                     <div class="price-total price-total-with-discount price-total-summary">
                         {if $product_discount.discount->isPositive() and $product_discount.discount->asFloat() >= 1}
                            <span class="flag flag-discount">
                               -{$product_discount.discount->asFloat()|round}%
                            </span>
                         {/if}
                        <div>
                           <p class="pieces-summary">
                               {$product.pieces|string_format:"%.{$product.product.unit.pieces_precision|default:0}f"}&nbsp;{$product.product.unit.short_name|default:"{t}ks{/t}"}
                           </p>
                            {if $product_discount.priceOriginal}
                               <del class="strike-price">{$product_discount.priceOriginal.value_with_vat->mul(toDecimal($product.pieces))|format_price}</del>
                            {/if}

                            {if $isB2BUser}
                               <strong>{$product.totalPrice.value_without_vat|format_price}</strong>
                            {else}
                               <strong>{$product.totalPrice.value_with_vat|format_price}</strong>
                            {/if}
                        </div>
                     </div>
                  {else}
                     <p class="price-total price-total-summary">
                         {if $isB2BUser}
                             {$product.totalPrice.value_without_vat|format_price:"ceil=no;decimal=dynamic"}
                         {else}
                             {$product.totalPrice.value_with_vat|format_price:"ceil=no;decimal=dynamic"}
                         {/if}
                     </p>
                  {/if}
               {/block}
                {if !$tpl_vars.ordering_products_discount}
                   <p class="pieces-summary">
                       {$product.pieces|string_format:"%.{$product.product.unit.pieces_precision|default:0}f"}&nbsp;{$product.product.unit.short_name|default:"{t}ks{/t}"}
                   </p>
                {/if}
            </div>
         </div>
         {block "product-extra-addons"}
            {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|default:$charge.admin_title} ({$charge.price|format_price:"ceil=no;decimal=dynamic"})</span>
                     {/if}
                  {/foreach}
               {/if}
            {/if}
            {/ifmodule}

            {ifmodule PRODUCT_GIFTS}
            {foreach $product.product.gifts as $gift_product}
               {if !$product.note.gifts[$gift_product.id].unwanted}
                  <span class="variation">+ {t}dárek{/t} {$gift_product.title}</span>
               {/if}
            {/foreach}
            {/ifmodule}
         {/block}
      {/foreach}

      {block 'summary-addons'}
         {include "ordering/ordering.summary.gift.tpl"}
         {include "ordering/ordering.summary.charges.tpl"}
      {/block}

   </div>
{/if}
