@inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>>
@using Dynamicweb

<div class="grid gap-0 h-100" id="DeliveryUser">
	<div class="g-col-12 g-col-lg-8 p-3 p-lg-4 pe-xl-5 ps-xl-6 ps-xxl-8 order-last order-lg-first" data-dw-colorscheme="@Pageview.CurrentParagraph?.ColorSchemeId">
		<form name="ordersubmit" id="ordersubmit" method="post" autocomplete="off" style="max-width: 65rem; margin-left: auto;">

			@Include("Helpers/Logo.cshtml")

			@Include("Helpers/StepsBreadcrumbs.cshtml")

			@Include("Helpers/Errors.cshtml")

			@Include("Helpers/StepSummary.cshtml")

			@Include("Helpers/ShippingMethods.cshtml")

			@Include("Helpers/OrderDeliveryDate.cshtml")

			@Include("Helpers/StepsNavigation.cshtml")

			<input type="hidden" id="CurrentStep">
		</form>
	</div>

	@Include("Helpers/SummarySidebar.cshtml")

</div>

<script>
	function submitForm() {
		document.querySelector("#CurrentStep").name = "@GetString("CartV2.CurrentStepButtonName")";
		swift.PageUpdater.Update(document.querySelector("#ordersubmit"));
	}
</script>

<script>
	window.dataLayer = window.dataLayer || [];
	window.dataLayer.push({
		event: "add_shipping_info",
		ecommerce: {
			currency: "@GetString("Ecom:Order.CurrencyCode")",
			value: @GetString("Ecom:Order.Price.Price.Value").Replace(",", "."),
			items: [
				@foreach (LoopItem orderline in GetLoop("OrderLines")) {
					<text>
					{
						item_id: "@orderline.GetString("Ecom:Order:OrderLine.ProductID")",
						item_name: "@orderline.GetString("Ecom:Order:OrderLine.ProductName")",
						currency: "@orderline.GetString("Ecom:Order:OrderLine.UnitPrice.CurrencyCode")",
						price: @orderline.GetDouble("Ecom:Order:OrderLine.UnitPriceWithProductDiscount.Price.Value").ToString("0.00", System.Globalization.CultureInfo.InvariantCulture),
						discount: @Math.Abs(orderline.GetDouble("Ecom:Order:OrderLine.UnitDiscount.Price.Value")).ToString("0.00", System.Globalization.CultureInfo.InvariantCulture),
						quantity: @orderline.GetDouble("Ecom:Order:OrderLine.Quantity").ToString("0.00", System.Globalization.CultureInfo.InvariantCulture)
					},
					</text>
				}
			]
		}
	});
</script>
