{extends "[common]email/order.tpl"}

{block order_items}
   {get_oc_parameter_id key='paramColor' assign='parameterColorId'}
   {if strpos($body.body, '{POLOZKY_OBJEDNAVKY}')}
      {$items = $order->fetchItems()}
      {capture assign=items}
         <table border="0" cellpadding="0" cellspacing="0" width="100%" style="border-collapse: collapse;margin-bottom: 20px;" class="table-products">
            <caption style="padding: 7px 0;border-bottom: 2px solid #f2f4f8;font-weight: 700;text-align:left;">{t}Seznam objednaného zboží{/t}:</caption>
            {foreach $items as $item}
               <tr>
                  <td style="border-bottom:1px solid #f2f4f8;padding: 7px 7px 7px 0;">
                     {if $item.id_product}
                        <a href="{url s='redir' type='product' id=$item.id_product absolute="1"}">
                           {$item.descr}
                           {$item.product->fetchParameters([$parameterColorId])|silent}
                           {if $item.product.param[$parameterColorId]}
                              ({t}Barva:{/t}&nbsp;{$item.product.param[$parameterColorId].value})
                           {/if}
                        </a>
                     {else}
                        {$item.descr}
                     {/if}
                  </td>
                  <td style="border-bottom:1px solid #f2f4f8;padding: 7px 7px 7px 0;text-align: right;white-space: nowrap;">{$item.pieces} {t}ks{/t}</td>
                  <td style="border-bottom:1px solid #f2f4f8;padding: 7px 0;text-align: right;white-space: nowrap;">{$item.total_price.value_with_vat_no_rounding|format_price}</td>
               </tr>
            {/foreach}
            <tr>
               <td style="border-top:1px solid #f2f4f8;padding: 7px 7px 7px 0;font-weight: 700;">{t}Celková cena objednaného zboží je{/t}:</td>
               <td colspan="2" style="border-top:1px solid #f2f4f8;padding: 7px 0;text-align: right;font-weight: 700;white-space: nowrap;">{$order.total_price_array.value_with_vat|format_price}</td>
            </tr>
         </table>
      {/capture}
      {$body.body = str_replace('{POLOZKY_OBJEDNAVKY}', $items, $body.body)}
   {/if}
{/block}
