{if !$changeStart}
    {$changeStart = 0}
{/if}
<style type="text/css" media="all">
{literal}

@media print {
    @page
    {
        margin: 12mm 9mm 0mm 4mm !important;
        padding: 0;
    }
}

BODY
    {
        margin:0;
        padding: 0;
    }
    #Stitky_2x6{
        text-align: center;
        position:relative;
        box-sizing: border-box;
        page-break-inside:always;
        float:left;
        width:192mm;
        margin:0;
        padding: 0;
    }

    #stitek{
        width: 64mm;
        height: 21mm;
        float: left;
        text-align: center;
        padding: 0 5mm;
        box-sizing: border-box;
    }
    #barcode{
        height: 32px;
        overflow: hidden;
    }
    p.title{
        font-size:9px;
        height: 11px;
        overflow: hidden;
        margin:0;
        padding:0;
    }
    p{
        font-size:9px;
        height: 13px;
        padding:0 20px;
    }
   p.codes{
      font-size:10px;
      margin: 0px 0 !important;
      padding: 0 10px;
   }
{/literal}
</style>
{$count = 39}
{foreach $products as $key => $product}
    {for $repeat = 1 to $product.pieces}
        {if $count == 39}
            <div id="Stitky_2x6">
        {/if}
        {for $for = 1 to $change_start}
            {$change_start =- 1}
            <div id="stitek">
            </div>
            {$count = $count -1}
        {/for}
          {block stitek}
             <div id="stitek">
                {block barcode}
                   <div id="barcode">
                      {if !empty($product.barcode.chars)}
                         <img src="{$cfg.Addr.full}_wpj/barcode/?oID={urlencode($product.barcode.chars)}&type={$product.barcode.chars_type}&height=30">
                      {/if}
                   </div>
                {/block}
                {block descr}
                   <p class="title">{$product.product_title}</p>
                   <p class="title">{$product.variation_title}</p>
                   <p class="codes">
                      <span style="float: left">{if $product.ean}EAN:{$product.ean}{elseif $product.code}KOD:{$product.code}{/if}</span>
                      <span style="float: right">{calcPrice($product.price, $product.vat)|format_price} s DPH</span>
                   </p>
                {/block}
             </div>
          {/block}
        {$count = $count -1}
        {if $count == 0}
            </div>
            {$count = 39}
        {/if}
    {/for}
{/foreach}
