@inherits RazorTemplateBase> @using Dynamicweb.Rendering; @using Dynamicweb.Content; @using System.Globalization; @using System.Linq @using Dynamicweb.Ecommerce.Products; @Include("../../includes/Razor/GetImage.cshtml") @Include("../../includes/Razor/VerifyImage.cshtml") @Include("../../includes/Razor/GetCurrentUrl.cshtml") @Include("../../eCom7/CartV2/Step/Includes/GetOrderlineType.cshtml") @Include("../../includes/PageTemplates/UserSettings.cshtml") @{ @Include("../../includes/razor/GeneralSettings.cshtml") bool userIsLoggedIn = Dynamicweb.Security.UserManagement.User.IsExtranetUserLoggedIn(); bool loadedVoucherBol = false; string print = !string.IsNullOrEmpty(System.Web.HttpContext.Current.Request.Params["print"]) ? "print" : ""; string paragraphID = Dynamicweb.Frontend.PageView.Current().CurrentParagraph.ID.ToString(); string pageId = Pageview.Page.ID.ToString(); string urlString = "/Default.aspx?ID=" + pageId + "&CC" + paragraphID + "=Order&OrderID=" + GetString("Ecom:Order.ID"); string voucherValue = GetString("Ecom:Order.Customer.VoucherCode"); List orderlines = GetLoop("OrderLines"); double subtotal = 0; string colWithUserLogged = userIsLoggedIn || print == "print" ? "col-xs-12" : "col-xs-12 col-sm-8"; string paragraphId = Pageview.CurrentParagraph.ID.ToString(); string printDetail = "/Default.aspx?ID="+ pageId + "&CC"+paragraphId+"=Order&OrderID="+GetString("Ecom:Order.ID") + "&LayoutTemplate=" + System.Web.HttpContext.Current.Request.Params["LayoutTemplate"] + "&print=true"; DateTime dt = (GetDate("Ecom:Order.Completed").ToString().Contains("1/1/0001")) ? GetDate("Ecom:Order.Date") : GetDate("Ecom:Order.Completed"); Dictionary dict_discounts = new Dictionary(); System.Web.HttpCookie cookiesObj = new System.Web.HttpCookie("userAndPass"); cookiesObj.Expires = DateTime.Now.AddDays(-1d); List trackTraceParameters = GetLoop("TrackTraceParameters").Where(p => !String.IsNullOrEmpty(p.GetString("Ecom:Order.TrackTraceParameter.Value"))).ToList(); System.Web.HttpContext.Current.Response.Cookies.Add(cookiesObj); if (System.Web.HttpContext.Current.Request.Params["LayoutTemplate"] == null && System.Web.HttpContext.Current.Request.Params["recurring"] == null) { urlString += "&LayoutTemplate=Designs/" + designName + "/index-account.cshtml"; System.Web.HttpContext.Current.Response.Redirect(urlString); } var shippingMethod = Dynamicweb.Ecommerce.Orders.Shipping.GetShippingmethodById(GetString("Ecom:Order.ShippingMethodID")); var shippingMethodDescription = shippingMethod != null && !string.IsNullOrEmpty(shippingMethod.Description) ? shippingMethod.Description : GetString("Ecom:Order.ShippingMethod"); var paymentMethod = Dynamicweb.Ecommerce.Orders.Payment.GetPaymentMethods().FirstOrDefault(x => x.Name == GetString("Ecom:Order.PaymentMethod")); var paymentMethodDescription = paymentMethod != null && !string.IsNullOrEmpty(paymentMethod.Description) ? paymentMethod.Description : GetString("Ecom:Order.PaymentMethod"); string trackTraceURL = GetString("Ecom:Order.TrackTraceURL"); //personalization Dictionary personalizationProductNumbers = new Dictionary(); var personalizationGroup = Group.GetGroupById("GROUP55"); var personalizationProducts = personalizationGroup != null ? Product.GetProductsByGroup(personalizationGroup).Select(p=>p.Number).ToList() : new List(); bool orderHasShipped = false; bool.TryParse(Dynamicweb.Ecommerce.Orders.OrderState.GetOrderstates("OS12").FirstOrDefault().Name.Equals(GetString("Ecom:Order:Orderstate.Name")).ToString(), out orderHasShipped); //OrderDeliveryCOntact.Clean }

@Translate("orderDetails", "Order Details")

@Translate("orderNumber", "Order Number"):
@GetString("Ecom:Order.ID")
@Translate("orderDate", "Order date"):
@dt.ToString("MM/dd/yyyy")
@Translate("paymentMethod", "Payment method"):
@GetString("Ecom:Order.PaymentMethod")
@if(!String.IsNullOrEmpty(GetString("PONumber.Clean"))) {
@Translate("poNumber","PO Number"):
@GetString("PONumber.Clean")
}
@Translate("shippingMethod", "Shipping method"):
@shippingMethodDescription
@Translate("status","Status"):
@GetString("Ecom:Order:Orderstate.Name")
@Translate("trackingNumber", "Tracking #"):
@RenderTrackTraceNumbers(trackTraceParameters, @trackTraceURL)

@Translate("billedAddress", "Billing Address")

@GetString("Ecom:Order.Customer.Company")
@GetString("Ecom:Order.Customer.Address")
@if(!string.IsNullOrEmpty(GetString("Ecom:Order.Customer.Address2"))) {
@GetString("Ecom:Order.Customer.Address2")
}
@GetString("Ecom:Order.Customer.City"), @GetString("Ecom:Order.Customer.Region") @GetString("Ecom:Order.Customer.Zip")
@GetString("Ecom:Order.Customer.Country")
@GetString("Ecom:Order.Customer.Phone")
@GetString("Ecom:Order.Customer.Email")

@Translate("shippingAddress", "Shipping Address")

@GetString("Ecom:Order.Delivery.Company")
@GetString("Ecom:Order.Delivery.Name")
@GetString("Ecom:Order.Delivery.Address")
@if(!string.IsNullOrEmpty(GetString("Ecom:Order.Delivery.Address2"))) {
@GetString("Ecom:Order.Delivery.Address2")
}
@GetString("Ecom:Order.Delivery.City"), @GetString("Ecom:Order.Delivery.Region") @GetString("Ecom:Order.Delivery.Zip")
@GetString("Ecom:Order.Delivery.Country")
@GetString("Ecom:Order.Delivery.Phone")
@GetString("Ecom:Order.Delivery.Email")
@if (!userIsLoggedIn) {

@Translate("createAnAccount", "Create an account by providing a password below.")

@Translate("weSaveYourInformation", "We’ll save your information so you don’t have to enter it again on your next order.")
@Translate("thisWillBeYourUsername", "This will be your Username")
@GetString("Ecom:Order.Customer.Email")
}
@if (!string.IsNullOrEmpty(GetString("ShippingInstructions.Clean"))) {

@Translate("shippingInstructions", "Shipping Instructions")

@GetString("ShippingInstructions.Clean")
}
@Translate("totalPrice", "Total Price")
    @foreach (LoopItem orderLine in GetLoop("OrderLines")) { double orderlineStock = orderLine.GetDouble("Ecom:Order:OrderLine.Quantity"); bool isProduct = orderLine.GetBoolean("Ecom:Order:OrderLine.IsProduct"); bool isDiscount = false; int productStock = orderLine.GetInteger("Ecom:Product.AvailableAmount"); int productQuantity = orderLine.GetInteger("Ecom:Order:OrderLine.Quantity"); string orderlineType = orderLine.GetString("Ecom:Order:OrderLine.Type"); string productId = orderLine.GetString("Ecom:Order:OrderLine.ProductID"); string discountType = GetOrderlineType(orderlineType, isProduct, productId, voucherValue); string productName = orderLine.GetString("Ecom:Order:OrderLine.ProductName"); productName = orderLine.GetString("Ecom:Product:Field.ProductWebName"); //string productNumber = !string.IsNullOrEmpty(orderLine.GetString("Ecom:Product.Number")) ? orderLine.GetString("Ecom:Product.Number") : orderLine.GetString("Ecom:Order:OrderLine.ProductNumber"); string productNumber = !string.IsNullOrEmpty(orderLine.GetString("Ecom:Order:OrderLine.ProductNumber")) ? orderLine.GetString("Ecom:Order:OrderLine.ProductNumber") : ""; bool isPersonalization = personalizationProducts.Contains(productNumber); string pattern = "/Files/Files/" + designName + "/Products/" + productNumber + ".jpg"; string imageUrl = GetImagePathUrl(orderLine.GetString("Ecom:Product.ImageSmall.Clean"), orderLine.GetString("Ecom:Product.ImageMedium.Clean"), orderLine.GetString("Ecom:Product.ImageLarge.Clean"), pattern); string showPriceSelect = productQuantity < 10 && productStock > 0 ? "hidden" : ""; string productFriendlyUrl = Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl(itemArea["ProductDetail"].ToString() + "&ProductID=" + productId); string variantText = orderLine.GetString("Ecom:Order:OrderLine.ProductVariantText"); double productWholesalePrice = orderLine.GetDouble("Ecom:Product:Field.WholesalePrice"); if(string.IsNullOrEmpty(discountType)) {
  • @if(!@isPersonalization){
    @productName

    @productName @if (!string.IsNullOrEmpty(variantText)) {
    @variantText }

    @if (!string.IsNullOrEmpty(productNumber)) {
    @Translate("item#", "Item #"): @productNumber
    }
    } else {

    @productName

    @if (!string.IsNullOrEmpty(productNumber)) {
    @Translate("item#", "Item #"): @productNumber
    }
    }
    @if (orderLine.GetString("Ecom:Order:OrderLine.Points") == "0") { @orderLine.GetString("Ecom:Order:OrderLine.UnitPrice")
    } else { @orderLine.GetString("Ecom:Order:OrderLine.UnitPoints")@: @Translate(orderLine.GetString("Ecom:Order:OrderLine.UnitPoints") == "1" ? "point" : "points") }
    @productQuantity
    @{ subtotal += orderLine.GetDouble("Ecom:Order:OrderLine.TotalPriceWithProductDiscounts.Price"); double discountAmount = orderLine.GetDouble("Ecom:Order:OrderLine.TotalPriceWithProductDiscounts.PriceWithoutVAT") - (orderLine.GetDouble("Ecom:Order:OrderLine.Quantity") * orderLine.GetDouble("Ecom:Order:OrderLine.UnitPrice.Price")); if (discountAmount != 0) {
    @Dynamicweb.Ecommerce.Common.Context.Currency.Format(discountAmount,true)
    } else { } }
    @orderLine.GetString("Ecom:Order:OrderLine.TotalPriceWithProductDiscounts.PriceWithoutVATFormatted")
  • } }
@if (GetDouble("Ecom:Order.RewardTotalPoints") != 0) { }
@Translate("subTotal", "Subtotal")
@Dynamicweb.Ecommerce.Common.Context.Currency.Format(subtotal,true)
@if (!string.IsNullOrWhiteSpace(voucherValue)) {
@Translate("voucherCode", "Voucher Code"): @voucherValue
}
@Translate("shippingFee", "Shipping fee") (@GetString("Ecom:Order.ShippingMethod"))
@string.Format("{0}", orderHasShipped ? GetString("Ecom:Order.ShippingFee.PriceWithoutVATFormatted") : string.Empty)
@if (!orderHasShipped) { if (isB2B) { @Translate("shippingAndTaxesOrderProcessed","* Shipping and applicable taxes will be calculated when the order is processed") } else { @Translate("VATIsIncludedInTheProductPrice","* VAT is included in the product price") } } @if (orderlines.Where(t => t.GetString("Ecom:Order:OrderLine.Type") == "1").Sum(s => s.GetDouble("Ecom:Order:olPrice.Price")) != 0) {
@Translate("orderSavings", "Order Savings")
@Dynamicweb.Ecommerce.Common.Context.Currency.Format(orderlines.Where(t => t.GetString("Ecom:Order:OrderLine.Type") == "1").Sum(s => s.GetDouble("Ecom:Order:olPrice.Price")),true)
} @*
@Translate("taxes", "Taxes")
@GetString("Ecom:Order.Taxes.Total")
*@
@Translate("total", "* Total")
@String.Format("{0}", !orderHasShipped && (isDistributor || isB2B) ? Dynamicweb.Ecommerce.Common.Context.Currency.Format((GetDouble("Ecom:Order.PriceWithoutFees.Price") - GetDouble("Ecom:Order.Taxes.Total.Price")), true) : GetString("Ecom:Order.Price"))
@if (GetBoolean("Ecom:Order.Recurring.Enabled")) {

@Translate("recurringOrder", "Recurring Order")

@Translate("every", "Every"):
@GetString("Ecom:Order.Recurring.Interval") @GetString("Ecom:Order.Recurring.IntervalUnit.Name")
@Translate("endDate", "End Date"):
@GetDate("Ecom:Order.Recurring.EndDate.Clean").ToString("MM/dd/yyyy")
} @if (!string.IsNullOrEmpty(GetString("Ecom:Order.Customer.Comment.Clean"))) {

@Translate("giftMessage", "Gift Message")

@GetString("Ecom:Order.Customer.Comment.Clean")
}
@SnippetStart("jsOnLoad") onLoadCartStep3(null, '@print'); @SnippetEnd("jsOnLoad") @helper RenderTrackTraceNumbers(List trackTraceNumbers, string trackTraceUrl){ var showLink = trackTraceUrl.ToLower().StartsWith("http"); string shippingProvider = ""; shippingProvider = trackTraceUrl.Contains("fedex.com") ? "FedEx" : shippingProvider; shippingProvider = trackTraceUrl.Contains("ups.com") ? "UPS" : shippingProvider; foreach (var ttn in trackTraceNumbers) { if (showLink) { @shippingProvider @ttn.GetString("Ecom:Order.TrackTraceParameter.Value")
} else { @ttn.GetString("Ecom:Order.TrackTraceParameter.Value")
} } }