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

@{
	string termsAndConditionsCheckboxValue = GetBoolean("Ecom:Order.Customer.Accepted").ToString();
	string termsAndConditionsPageLink = Pageview.CurrentParagraph.Item["TermsAndConditionsPageLink"] != null ? Pageview.CurrentParagraph.Item["TermsAndConditionsPageLink"].ToString() : string.Empty;
}

@if (!string.IsNullOrEmpty(termsAndConditionsPageLink))
{
	<div class="mt-4" id="TermsAndConditions">
		<h3 class="fs-6 fw-normal mb-0">@Translate("Terms and conditions")</h3>
		<p class="fs-8 mb-3">@Translate("Agree to terms and conditions and that your informations are correct")</p>
		<div class="list-group">
			<label class="list-group-item list-group-item-action d-flex justify-content-between" for="EcomOrderCustomerAccepted">
				<span class="d-flex justify-content-between align-items-center gap-3">
					<input class="form-check-input m-0" type="checkbox" name="EcomOrderCustomerAccepted" id="EcomOrderCustomerAccepted" value="@termsAndConditionsCheckboxValue" @if (GetString("Ecom:Order.Customer.Accepted") == "true") { <text> checked="checked" </text> }>
					<span>@Translate("I accept the") <a href='/@termsAndConditionsPageLink' target='_blank' rel='noopener' id="TermsAndConditionsButton">@Translate("terms and conditions")</a></span>
				</span>
			</label>
		</div>
	</div>
}

