{*
Template: address.html
Description: This template handles the first step of the checkout.
Author: 1260 A/S, @1260-digital
Since: 2022-09-01
*}>
<{assign var="shipping_methods" value=$webshop->getShippings()}>
<{assign var="payment_methods" value=$webshop->getPaymentGateways()}>
<{assign var="skip_approve" value=$webshop->getSkipApprove()}>
<{capture name="title_basket_value"}>
<{$price|number_format:2:$smarty.capture.decimal:$smarty.capture.thousand}> <{$currency}>
<{/capture}>
<{capture name="title"}>
<{if $shipping_methods|@count == 1 && $payment_methods|@count == 1 && $skip_approve}>
<{t section="Address" x=$total_amount y=$smarty.capture.title_basket_value s=$webshop->getName()}>You have {x} item(s) in your basket at a total of {y} - {s}<{/t}>
<{elseif $shipping_methods|@count == 1 && $payment_methods|@count == 1}>
<{t section="Address" x=$total_amount y=$smarty.capture.title_basket_value s=$webshop->getName()}>Step 1 of 2 - You have {x} item(s) in your basket at a total of {y} - {s}<{/t}>
<{else}>
<{t section="Address" x=$total_amount y=$smarty.capture.title_basket_value s=$webshop->getName()}>Step 1 of 3 - You have {x} item(s) in your basket at a total of {y} - {s}<{/t}>
<{/if}>
<{/capture}>
<{include file="partials/checkout.start.html"}>
<{if $get.exists}>
<{include file="components/alert.html" variant="error" icon="x" text="A profile with that email already exists"|t}>
<{/if}>
<{if $get.missing_address}>
<{include file="components/alert.html" variant="error" icon="x" text="An address is missing"|t}>
<{/if}>
<{if $get.delivery_country}>
<{include file="components/alert.html" variant="error" icon="x" text="We do not deliver to the selected country. Please choose a delivery address in one of the countries we deliver to."|t}>
<{* Leveringsadressen åbnes, så kunden kan vælge et land, butikken leverer til. Formularens
tilstand huskes i localStorage ("user"), som checkoutAddress() i app.js (defer) læser bagefter. *}>
<{/if}>
<{assign var="countries" value=$webshop->getCountries()}>
<{* Leveringsadressen kun i de lande, butikken leverer til (i et land under Lande kan det være
færre). Fakturaadressen må ligge i alle shoppens lande. *}>
<{assign var="delivery_countries" value=$webshop->getDeliveryCountries()}>
<{section name="i" loop=$countries}>
<{if ! $defaultCountryId || $countries[i]->getIsDefault()}>
<{assign var="defaultCountryId" value=$countries[i]->getCountryId()}>
<{/if}>
<{if $countries[i]->getCode() === 'DK'}>
<{assign var="countryIdForDK" value=$countries[i]->getCountryId()}>
<{/if}>
<{/section}>
<{if ($settings.checkout_address.enable_b2b && $settings.checkout_address.enable_b2c ||
$settings.checkout_address.enable_b2b && $settings.checkout_address.enable_b2g ||
$settings.checkout_address.enable_b2c && $settings.checkout_address.enable_b2g) }>
<{assign var="multiple_order_types" value=true}>
<{else}>
<{assign var="multiple_order_types" value=false}>
<{/if}>