{get_stats type='cart_free_delivery' assign='free_delivery'}

{if $free_delivery and $free_delivery->isPositive() and $cartPrice}
   <div class="shipping-progress">
      <span class="fc {$fonticon|default:"icons_delivery"}"></span>
      <p>
         {if $free_delivery->lowerThanOrEqual($cartPrice) or $body.freeShipping or $cartInfo.freeShipping}
            <strong> {t}Dopravu máte zdarma{/t}</strong>
         {else}
            {t}K dopravě zdarma zbývá{/t}
            <strong>{$free_delivery->sub($cartPrice)|format_price:"ceil=no;decimal=dynamic"}</strong>
         {/if}
      </p>

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