<{assign var="enable" value=$settings.shipping.enable_free_shipping_notice}> <{if $enable}> <{assign var="countries" value=$webshop->getCountries()}> <{assign var="free_shipping_possible" value=false}> <{assign var="free_shipping_above" value=false}> <{assign var="notice_threshold" value=$settings.shipping.free_shipping_notice_threshold|default:0}> <{section name="c" loop=$countries}> <{if $countries[c] && ! $free_shipping_above}> <{assign var="country_id" value=$countries[c]->getCountryId()}> <{if $country_id == $session_del.country_id}> <{assign var="free_shipping_possible" value=$countries[c]->getFreeAbove()}> <{assign var="shipping_country" value=$countries[c]->getName()}> <{if $free_shipping_possible}> <{assign var="free_shipping_above" value=$free_shipping_possible}> <{/if}> <{/if}> <{/if}> <{/section}> <{* The threshold as checkout uses it: the customer's country, otherwise the default country, and the shipping method's own threshold *}> <{if isset($free_shipping_limit)}> <{assign var="free_shipping_above" value=$free_shipping_limit}> <{/if}> <{* Add-ons can be excluded from the free shipping threshold *}> <{assign var="basket_value" value=$free_shipping_price|default:$price}> <{if $free_shipping_above}> <{math assign="basket_value_needed_for_free_shipping" equation="x - y" x=$free_shipping_above y=$basket_value}> <{if $basket_value_needed_for_free_shipping < 0.01}><{assign var="basket_value_needed_for_free_shipping" value=0.01}><{/if}> <{/if}>
<{* No threshold in the customer's country: no notice *}> <{if $free_shipping_above && ($basket_value >= $notice_threshold || $notice_threshold == 0)}> <{if $never_free_shipping}> <{capture name="alert_text"}> <{t section="Alert"}>One or more products in your basket is not eligible for free shipping.<{/t}> <{/capture}> <{include file="components/alert.html" margin="b" variant="info" text=$smarty.capture.alert_text}> <{* Checkout only gives free shipping when the basket is ABOVE the threshold *}> <{elseif $basket_value > 0 && $basket_value <= $free_shipping_above}> <{capture name="alert_text"}> <{t section="Alert" x=$basket_value_needed_for_free_shipping|number_format:2:$smarty.capture.decimal:$smarty.capture.thousand y=$currency}>You are {x} {y} from free shipping.<{/t}> <{/capture}> <{include file="components/alert.html" margin="b" variant="info" text=$smarty.capture.alert_text}> <{elseif $basket_value > $free_shipping_above}> <{capture name="alert_text"}> <{t section="Alert"}>You are eligible for free shipping.<{/t}> <{/capture}> <{capture name="alert_action"}> <{t section="Alert"}>Go to checkout<{/t}> <{/capture}> <{include file="components/alert.html" variant="success" text=$smarty.capture.alert_text action=$smarty.capture.alert_action}> <{/if}> <{/if}>
<{/if}>