{extends_parent}

{block 'image'}
   {$photo_dimensions = $cfg.Photo.types["product_cart"].size}
   <img src="{get_photo photo=$product.image size='product_cart'}" alt="{$product.title}"
        width="{$photo_dimensions[0]}" height="{$photo_dimensions[1]}" class="img-responsive">
{/block}

{block 'title'}
   {get_oc_parameter_id key='paramColor' assign='parameterColorId'}
   <a href="{url s=product IDproduct=$product.id TITLE=$product.title}"
      title="{t}Zobrazit produkt{/t}">{$product.product.title}</a>
   <div class="variation-wrapper">
      {if $product.note['variationTitle']}
         <span class="variation">{$product.note['variationTitle']}</span>
      {elseif $product.id_variation}
         <span class="variation">{$product.product.variationTitle}</span>
      {/if}
      {$product.product->fetchParameters([$parameterColorId])|silent}
      {if $product.product.param[$parameterColorId]}
         <span class="variation">,&nbsp;</span><span class="variation variation-color">{t}Barva:{/t}&nbsp;{$product.product.param[$parameterColorId].value}</span>
      {/if}
   </div>

   {if $product.product and $product.note}
      <span class="variation">{$product.product->printNote($product.note)}</span>
   {/if}
{/block}

{block "piece-price"}{/block}

{block "price-total"}
   <div class="price-total">
      {$priceCommon = $product.product.productPrice.value_with_vat_without_discount->mul(toDecimal($product.pieces))}
      {* Pokud mam naceneno pres SAP, tak preberu jeho data *}
      {if !empty($product.note.sap)}
          {$priceCommon = $product.note.sap.priceCommon}
          {$product_discount = $product.note.sap.discount}
      {else}
          {$product_discount = $product.discount}
      {/if}

      {if !$product_discount || !$product_discount->isPositive()}
          {$product_discount = $product.discount}
      {/if}

      {if $product_discount && $product_discount->isPositive()}
         <span class="flag flag-discount">-{$product_discount->asFloat()|round}%</span>
      {/if}
      <div class="availability-resp">
         {printAvailability}
      </div>
      <div>
         {if $product_discount && $product_discount->isPositive()}
            <span>{$priceCommon|format_price}</span>
         {/if}
         <strong>{$product.totalPriceWithDiscounts.value_with_vat|format_price:"ceil=no;decimal=dynamic"}</strong>
      </div>
   </div>
{/block}
