{if !$free_delivery and !$body.freeShipping}
   {get_stats type='free_delivery' assign='free_delivery'}
{/if}

{if ($body.freeShipping or ($free_delivery and $free_delivery->isPositive())) and $cartPrice}
   <div class="shipping-progress-outer">
      <div class="shipping-progress">
         <span class="fc icons_delivery"></span>
         <p>
            {block "shipping-progress-price"}
               {if ($free_delivery and $free_delivery->lowerThanOrEqual($cartPrice)) or $body.freeShipping}
                  <strong>{t}Dopravu máte zdarma{/t}</strong>
                  {*<small>{t cena=$free_delivery|format_price escape=false}Doprava zdarma od <strong>{cena}</strong>{/t}</small>*}
               {else}
                  {$freedeliveryvalue = $free_delivery->sub($cartPrice)|format_price}
                  {t cena=$freedeliveryvalue escape=false}K dopravě zdarma zbývá <strong>{cena}</strong>{/t}
               {/if}
            {/block}
         </p>

         {if !(($free_delivery and $free_delivery->lowerThanOrEqual($cartPrice)) or $body.freeShipping)}
            <div class="shipping-bar">
                  {$barwidth=($cartPrice->div($free_delivery)->asFloat())*100}
                  <span style="width: {$barwidth|round}%;"></span>
            </div>
         {/if}
      </div>
      {block 'additional'}{/block}
   </div>
{/if}
