@inherits Dynamicweb.Rendering.RazorTemplateBase> @Include("../../../_wrap/WrapMethods.cshtml") @using System.Text.RegularExpressions @using Dynamicweb.Core @{ string columnwidth = "col-lg-4 col-md-4"; }
@foreach (LoopItem errors in GetLoop("ValidationErrors")) { @errors.GetValue("HeaderStart")

@Translate("Ooops!", "Ooops!")

@errors.GetValue("HeaderEnd") }
 
@RenderReturningCustomer() @RenderBillingAddress() @RenderDeliveryAddress()
@if (Converter.ToBoolean(Pageview.Area.Item["CartShipping"]) || Converter.ToBoolean(Pageview.Area.Item["CartPayment"]) || Converter.ToBoolean(Pageview.Area.Item["CartVouchers"]) || Converter.ToBoolean(Pageview.Area.Item["CartGiftcards"]) || Converter.ToBoolean(Pageview.Area.Item["CartReccuringOrders"])) {
@if (Converter.ToBoolean(Pageview.Area.Item["CartShipping"])) { @RenderShipping() } @if (Converter.ToBoolean(Pageview.Area.Item["CartPayment"])) { @RenderPayment() } @if (Converter.ToBoolean(Pageview.Area.Item["CartVouchers"])) { @RenderVoucher() } @if (Converter.ToBoolean(Pageview.Area.Item["CartGiftcards"])) { @RenderGiftcard() } @if (Converter.ToBoolean(Pageview.Area.Item["CartReccuringOrders"])) { @RenderRecurring() }
}
@RenderOrder() @RenderComment() @RenderSubmitOrder()
@helper RenderHeader(string icon, string title) {

@title

} @helper RenderReturningCustomer() { if (GetBoolean("Ecom:Cart.CreateUserInCheckout") && string.IsNullOrWhiteSpace(GetGlobalValue("Global:Extranet.UserName"))) {
@RenderHeader("user", Translate("Returning customer", "Returning customer"))

@Translate("Already a user?", "Already a user?")

@{ string signInPageId = (new Regex(@"\d+")).Match(Pageview.Area.Item["SignInPageId"].ToString()).Value; } @Translate("Sign in", "Sign in")
} } @helper RenderBillingAddress() {
@RenderHeader("file-text", Translate("Billing address", "Billing address")) @if (GetLoop("UserManagement:User.UserAddresses").Count > 0) {
@{ string userProfilePageId = (new Regex(@"\d+")).Match(Pageview.Area.Item["UserProfilePageId"].ToString()).Value; } @Translate("Add new address", "Add new address")
}
@{ var checkstring = "checked"; if (string.IsNullOrWhiteSpace(GetString("Ecom:Order.Delivery.Address2"))) { checkstring = ""; } else { checkstring = "checked"; } }
} @helper RenderDeliveryAddress() { } @helper RenderShipping() { if (GetLoop("Shippingmethods").Count > 0) {
@RenderHeader("truck", Translate("Shipping", "Shipping"))
@foreach (LoopItem shipping in GetLoop("Shippingmethods")) {
if (!string.IsNullOrWhiteSpace(shipping.GetString("Ecom:Cart.Shippingmethod.IsSelected")) && !string.IsNullOrWhiteSpace(shipping.GetString("Ecom:ShippingProvider.Content"))) { @shipping.GetString("Ecom:ShippingProvider.Content"); } }
} } @helper RenderPayment() {
@RenderHeader("credit-card", Translate("Payment", "Payment"))
@if (!string.IsNullOrWhiteSpace(GetGlobalValue("Global:Extranet.Name"))) { var cards = GetLoop("SavedCards"); if (cards.Count > 0) {
@Translate("Pay with saved cards", "Pay with saved cards")
foreach (LoopItem card in cards) { string checkedAttr = card.GetBoolean("Ecom:SavedCard.IsSelected") ? "checked" : null;
}
@Translate("Or pay with one of these payment methods:", "Or pay with one of these payment methods:")
} } @foreach (LoopItem payment in GetLoop("Paymethods")) {
@if (string.IsNullOrWhiteSpace(payment.GetString("Ecom:Cart.Paymethod.Price.IsZero"))) { payment.GetString("Ecom:Cart.Paymethod.Price"); }
@*SAVED CARDS*@ string SavedCardName = payment.GetString("Ecom:Order.SavedCardName"); bool SavedCardNameIsNull = string.IsNullOrWhiteSpace(SavedCardName); string a_checked = !SavedCardNameIsNull ? "checked" : ""; if (payment.GetBoolean("Ecom:Cart.Paymethod.IsSelected") && payment.GetBoolean("Ecom:Cart.Paymethod.SupportSavedCard")) {
} }
} @helper RenderRecurring() { if (!string.IsNullOrWhiteSpace(GetString("Ecom:Order.PaymentMethod.RecurringSupport"))) {
@{ string RecurringEnabled = ""; string Interval = ""; string recurringShow = "hidden"; if (!string.IsNullOrWhiteSpace(GetString("Ecom:Order.Recurring.Enabled"))) { RecurringEnabled = "checked=\"checked\""; recurringShow = "show"; } if (!string.IsNullOrWhiteSpace(GetString("Ecom:Order.Recurring.Interval"))) { Interval = "value=\"" + @GetString("Ecom:Order.Recurring.Interval") + "\""; } string seldays = ""; string selweeks = ""; string selmonths = ""; if (GetInteger("Ecom:Order.Recurring.IntervalUnit") == 0) { seldays = "selected=\"selected\""; } if (GetInteger("Ecom:Order.Recurring.IntervalUnit") == 1) { selweeks = "selected=\"selected\""; } if (GetInteger("Ecom:Order.Recurring.IntervalUnit") == 2) { selmonths = "selected=\"selected\""; } } @RenderHeader("calendar", Translate("Recurring", "Recurring"))
@*
@GetString("Ecom:Order.Recurring.EndDate").Replace("

} @helper RenderVoucher() {
@RenderHeader("money", Translate("Voucher", "Voucher"))
} @helper RenderGiftcard() {
@RenderHeader("gift", Translate("Gift card", "Gift card"))
} @helper RenderOrder() {
@RenderHeader("check", Translate("Review Order", "Review Order")) @{ var productcatalog = (new System.Text.RegularExpressions.Regex(@"\d+")).Match(Pageview.Area.Item["ProductsPageId"].ToString()).Value; } @foreach (LoopItem orderline in GetLoop("OrderLines")) { var n = orderline.GetString("OrderLines.LoopCounter"); var productId = orderline.GetString("Ecom:Order:OrderLine.ProductID"); string image = ""; string productlink = orderline.GetString("Ecom:Order:OrderLine.ProductLink.Fixed"); if (orderline.GetString("Ecom:Product.ImageLarge.Clean") != "") { image = "/Admin/Public/Getimage.ashx?width=200&height=200&compression=85&Crop=7&image=" + orderline.GetString("Ecom:Product.ImageLarge.Clean"); } if (orderline.GetBoolean("Ecom:Order:OrderLine.IsProduct")) { } else { } foreach (LoopItem bomitem in orderline.GetLoop("BOMItems")) { } } @if (Dynamicweb.Security.UserManagement.License.IsModuleInstalled("LoyaltyPoints")) { }
@if (@productlink != "" & @image != "") { @orderline.GetString( }
@if (@productlink != "") { @orderline.GetString("Ecom:Order:OrderLine.ProductName") } else {
@orderline.GetString("Ecom:Order:OrderLine.ProductName")
} @if (!string.IsNullOrWhiteSpace(orderline.GetString("Ecom:Order:OrderLine.ProductVariantText"))) {
@orderline.GetString("Ecom:Order:OrderLine.ProductVariantText")
}
@orderline.GetString("Ecom:Product:Stock.DeliveryText") @orderline.GetString("Ecom:Product:Stock.DeliveryUnit")
@if (orderline.GetInteger("Ecom:Order:OrderLine.Points") > 0) {
@orderline.GetDouble("Ecom:Order:OrderLine.Points") @Translate("points", "points")
} else {
@orderline.GetString("Ecom:Order:OrderLine.TotalPrice")
}
@if (orderline.GetString("Ecom:Order:OrderLine.Type") == "4") { } else { } @orderline.GetString("Ecom:Order:OrderLine.ProductName") @orderline.GetString("Ecom:Order:OrderLine.TotalPrice")
@bomitem.GetString("Ecom:Order:OrderLine.Quantity")   @bomitem.GetString("Ecom:Order:OrderLine.ProductName") @bomitem.GetString("Ecom:Order:OrderLine.TotalPrice")
  @GetString("Ecom:Order.PaymentMethod") @GetString("Ecom:Order.PaymentFee")
  @GetString("Ecom:Order.ShippingMethod") @GetString("Ecom:Order.ShippingFee")
@Translate("You used", "You used") @GetString("Ecom:Order.TotalPoints") points
@Translate("You earn", "You earn") @GetString("Ecom:Order.RewardTotalPoints") points
@Translate("Total point balance", "Total point balance") @{ var totalpointsafter = GetDouble("UserManagement:User.PointBalance") - @GetDouble("Ecom:Order.TotalPoints") + @GetDouble("Ecom:Order.RewardTotalPoints");}@totalpointsafter points
@Translate("Total", "Total") @GetString("Ecom:Order.OrderLines.Total.PriceWithVAT")
} @helper RenderSubmitOrder() {
Please accept the terms and conditions

@{ string curpage = GetGlobalValue("Global:Page.ID"); string quotes = (new Regex(@"\d+")).Match(Pageview.Area.Item["QuotesCartPageId"].ToString()).Value; } @if (curpage != quotes && !string.IsNullOrWhiteSpace(GetGlobalValue("Global:Extranet.UserName"))) { @Translate("Save cart as quote", "Save cart as quote") }

} @SnippetStart("JavaScriptBottom") @SnippetEnd("JavaScriptBottom")