<{if $order}>

	<div class="text-right">
		Ordre ID: <{$order->getWebshopOrderId()}>

		<{if $order->getInvoiceId()}>
			<br/>Fakturanummer: <{$order->getInvoiceId()}>
		<{/if}>
	</div>

	<h3 class="headline">Retuner varer</h3><span class="line margin-bottom-25"></span><div class="clearfix"></div>

	<div class="my-4">
		<a href="#small-dialog" class="popup-with-zoom-anim button color margin-left-0">Har du spørgsmål til din ordre?</a>
	</div>

	<div id="small-dialog" class="zoom-anim-dialog mfp-hide">
		<h3 class="headline">Spørgsmål</h3><span class="line margin-bottom-25"></span><div class="clearfix"></div>

		<form id="add-comment" class="add-comment" method="post">
			<input type="hidden" name="subject" value="Spørgsmål ang. ordre <{$order->getWebshopOrderId()|escape}>"/>
			<input type="hidden" name="order_url" value="<{$order->getPublicUrl()|escape}>"/>

			<fieldset>
				<p>Skriv dit spørgsmål her, og vi vender tilbage hurtigst muligt pr. mail:</p>

				<div>
					<label>Dit navn:</label>
					<input type="text" name="name" value="<{$order->getOrderName()|escape}>" size="50"/>
				</div>

				<div>
					<label>Din e-mail-adresse: <span>*</span></label>
					<input type="text" name="from" value="<{$order->getEmail()|escape}>" size="50" required/>
				</div>

				<div>
					<label>Dit spørgsmål: <span>*</span></label>
					<textarea cols="40" rows="3" name="question" required></textarea>
				</div>

			</fieldset>

			<input type="submit" value="Send" class="button color" id="send_button"/>
			<div class="clearfix"></div>

		</form>
	</div>

	<div class="row justify-content-center">
		<div class="col-10 col-md-12">
			<h3 class="headline">Produkter</h3><span class="line margin-bottom-35"></span><div class="clearfix"></div>
		</div>
	</div>

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

		<table class="cart-table responsive-table">
			<tr>
				<th>Produkt</th>
				<th class="text-right">Pris</th>
				<th class="text-right">Vælg</th>
			</tr>

			<{$line = 0}>

			<{foreach $order->getOrderProducts() as $product}>
				<{assign var="p" value=$product->getProduct()}>

				<{$returned = $product->getReturned()}>

				<{section name="i" loop=$product->getAmount()}>
					<{$line = $line+1}>

					<{if $line - $returned > 0}>

						<tr>
							<td>
								<{if $image = $p->getImage()}>
									<a href="<{$p->getRemoteUrl()|escape}>"><img src="<{$image->getSrc(50, 50, 'box')}>" <{$image->getHtmlSize(50, 50, 'box')}> alt="" style="border-radius:100px;"></a>
								<{/if}>

								<a href="<{$p->getRemoteUrl()|escape}>"><{$product->getName()|escape}></a>

								<{if $attributes = $product->getAttributes()}>
									<ul>
										<{foreach $attributes as $attribute}>
											<li><{$attribute.name}>: <{$attribute.val}></li>
										<{/foreach}>
									</ul>
								<{/if}>
							</td>

							<td class="text-right">
								<{if $webshop->getUseCalculatedUnitPrice()}>
									<strong><{$webshop->getCurrency()}> <{$product->getCalculatedUnitPrice()|number_format:2:",":"."}></strong>
									<div><small>Moms <{$webshop->getCurrency()}> <{$product->getCalculatedUnitVat()|number_format:2:",":"."}></small></div>
								<{else}>
									<strong><{$webshop->getCurrency()}> <{$product->getUnitPrice()|number_format:2:",":"."}></strong>
									<div><small>Moms <{$webshop->getCurrency()}> <{$product->getUnitVat()|number_format:2:",":"."}></small></div>
								<{/if}>
							</td>

							<td class="text-right">
								<label><input type="checkbox" name="return[<{$line}>]" value="<{$product->getOrderProductId()}>"> Vælg</label>
								<input style="float:right" type="text" name="reason[<{$line}>]" placeholder="Evt. årsag til returnering"/>
							</td>
						</tr>

					<{/if}>

				<{/section}>
			<{/foreach}>
		</table>

		<div class="mt-4"></div>

		<{if $return_shipping = $webshop->getReturnShipping($order->getDelCountryId())}>
			<p>
				<{t}>Varer skal returneres via<{/t}> <{$return_shipping->getName()|escape}>.

				<{if $webshop->getReturnShippingPrice($order->getDelCountryId())}>
					<{t currency=$webshop->getCurrency() price=$webshop->getReturnShippingPrice($order->getDelCountryId())|number_format:2:",":"."}>
						Pris for returlabel m.m. er {currency} {price}. Dette modregnes i den endelige returnering.
					<{/t}>
				<{else}>
					<{t currency=$webshop->getCurrency() price=$return_shipping->getCost()|number_format:2:",":"."}>
						Pris for returlabel m.m. er {currency} {price}. Dette modregnes i den endelige returnering.
					<{/t}>
				<{/if}>
			</p>
		<{else}>

			<div class="checkout-content">
				<label><{t}>Vælg returneringsmetode<{/t}></label>
				<select name="shipping_id">
					<{foreach $webshop->getShippings() as $shipping}>

						<{if $webshop->getReturnShippingPrice($order->getDelCountryId())}>
							<{$shipping_price = $webshop->getReturnShippingPrice($order->getDelCountryId())}>
						<{else}>
							<{$shipping_price = $shipping->getCost()}>
						<{/if}>

						<option value="<{$shipping->getShippingId()}>"><{$shipping->getName()|escape}> (<{$webshop->getCurrency()|escape}> <{$shipping_price|number_format:2:",":"."}>)</option>
					<{/foreach}>
				</select>
			</div>

		<{/if}>

		<input class="btn button" type="submit" name="opdate" value="Retuner valgte"/>

	</form>

	<div class="mt-4"></div>

<{else}>

	<div class="row">
		<div class="col-10 col-md-5 centered">

			<{if $get.not_found}>
				<div class="notification warning closeable">
					<p><{t}>Der blev ikke fundet nogen ordre.<{/t}></p>
				</div>
			<{/if}>

			<h3 class="headline"><{t}>Returcenter<{/t}></h3>
			<span class="line" style="margin-bottom:20px;"></span>
			<div class="clearfix"></div>

			<form method="post" action="">
				<p class="form-row form-row-wide form-row-margin0">
					<label for="webshop_order_id"><{t}>Ordrenummer<{/t}></label>
					<input type="text" class="input-text" name="webshop_order_id" id="webshop_order_id" value="" />
				</p>

				<p class="form-row form-row-wide form-row-margin0">
					<label for="email"><{t}>E-mail-adresse<{/t}></label>
					<input class="input-text" type="email" name="email" id="email" />
				</p>

				<p class="form-row form-row-margin0">
					<input type="submit" class="button" value="<{t}>Søg<{/t}>" />
				</p>
			</form>

		</div>
	</div>

<{/if}>