<{assign var="finpro" value=$webshop->getFinancialProducts()}>

<{if $finpro}>

	<{section name="i" loop=$finpro}>

		<{assign var="show_financial_product" value=true}>
		<{section name="j" loop=$basket}>
			<{assign var="product" value=$basket[j].product}>
			<{if $product->getProductId() == $finpro[i]->getProductId()}>
				<{assign var="show_financial_product" value=false}>
			<{/if}>
		<{/section}>

		<{if $show_financial_product && ($finpro[i]->getHasCreditUntil() || $finpro[i]->getHasCreditDays() || $finpro[i]->getHasCreditDate() || $finpro[i]->getIsVoucher())}>

			<form action="/" method="post">

				<div class="row mb-2">
					<div class="col-12">

						<div class="info-banner">
							<div class="info-content">

								<h3><{$finpro[i]->getName()|escape}></h3>
								<div>
									<label class="my-2 mb-2"><input type="checkbox" required><strong>
										<{$finpro[i]->getListDescription()|default:$finpro[i]->getDescription()}>

										<{if $finpro[i]->getHasCreditUntil()}>

											Pengene trækkes tidligst d. <{$finpro[i]->getCreditUntil()}> i
											<{if $finpro[i]->getCreditUntil() > $smarty.now|date_format:"%e"}>denne<{else}>næste<{/if}>
											måned.

										<{elseif $finpro[i]->getHasCreditDays()}>

											<{math assign="date" equation="x+(y*3600*24)" x=$smarty.now y=$finpro[i]->getCreditDays()}>

											Pengene trækkes tidligst om <{$finpro[i]->getCreditDays()}> dage. <{$date|date_format:"%A d. %e. %B"|lower|ucfirst}>

										<{elseif $finpro[i]->getHasCreditDate()}>

											Pengene trækkes tidligst d. <{$finpro[i]->getCreditDate()|date_format:"%A d. %e. %B %Y"|lower}>.

										<{elseif $finpro[i]->getIsVoucher()}>

											Tilgodebeviset på <{$finpro[i]->getVoucherAmount()|number_format:2:",":"."}> <{$webshop->getCurrency()}> gælder i <{$finpro[i]->getVoucherDays()}> dage

										<{/if}>

										<span class="highlight color">Pris <{$finpro[i]->getPrice()|number_format:2:",":"."}> <{$webshop->getCurrency()}></span>
									</strong></label>
									<input type="hidden" name="product_id" value="<{$finpro[i]->getProductId()}>"/>
									<input type="hidden" name="amount" value="1"/>
									<input type="hidden" name="redirect" value="basket"/>

									<{if $finpro[i]->getHasCreditUntil() || $finpro[i]->getHasCreditDays() || $finpro[i]->getHasCreditDate()}>
										<input type="submit" value="Tilføj kredit">
									<{elseif $finpro[i]->getIsVoucher()}>
										<input type="submit" value="Tilføj tilgodebevis">
									<{/if}>

								</div>

							</div>
							<div class="clearfix"></div>
						</div>

					</div>
				</div>

			</form>

		<{/if}>

	<{/section}>

<{/if}>