Error compiling template "Designs/Swift/Paragraph/SwiftRizzo_QuickOrderApp.cshtml"
Line 94: The type or namespace name 'SwiftRizzo' does not exist in the namespace 'Dna' (are you missing an assembly reference?)
Line 101: The type or namespace name 'SwiftRizzo' does not exist in the namespace 'Dna' (are you missing an assembly reference?)
Line 110: The type or namespace name 'SwiftRizzo' does not exist in the namespace 'Dna' (are you missing an assembly reference?)
1 // <auto-generated/>
2 #pragma warning disable 1591
3 namespace CompiledRazorTemplates.Dynamic
4 {
5 #line hidden
6 using System.Threading.Tasks;
7 using System;
8 using System.Collections.Generic;
9 using System.Linq;
10 using Dynamicweb;
11 using Dynamicweb.Frontend;
12 using System.IO;
13 internal class RazorEngine_59113944414349da9210b89fac8f6e5b : Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.ParagraphViewModel>
14 {
15 #pragma warning disable 1998
16 public async override global::System.Threading.Tasks.Task ExecuteAsync()
17 {
18 WriteLiteral("\r\n");
19 WriteLiteral("\r\n");
20
21 string theme = !string.IsNullOrWhiteSpace(Model.Item.GetRawValueString("Theme")) ? " theme " + Model.Item.GetRawValueString("Theme").Replace(" ", "").Trim().ToLower() : "";
22 int frontPageId = Dynamicweb.Content.Services.Pages.GetFirstPageForArea(Pageview.AreaID).ID;
23 string iconPath = "/Files/Templates/Designs/Swift/Assets/icons/";
24
25 LinkViewModel checkoutAnonymousPageId = Model.Item.GetLink("CheckoutAnonymousPageLink");
26 string checkoutAnonymousPageUrl = checkoutAnonymousPageId?.Url;
27 LinkViewModel checkoutUserPageId = Model.Item.GetLink("CheckoutUserPageLink");
28 string checkoutUserPageUrl = checkoutUserPageId?.Url;
29 string checkoutUrl = Pageview.User == null ? checkoutAnonymousPageUrl : checkoutUserPageUrl;
30 string userId = Pageview.User != null ? Dynamicweb.Core.Converter.ToString(Pageview.User.ID) : string.Empty;
31 string prePopulateWithProductMinQuantity = Model.Item.GetBoolean("PrePopulateWithProductMinimumQuantity").ToString();
32 int quoteCheckoutPageLink = Model.Item?.GetLink("QuoteCheckoutPageLink") != null ? Model.Item.GetLink("QuoteCheckoutPageLink").PageId : 0;
33 int productListPageLink = Model.Item?.GetLink("ProductListPage") != null ? Model.Item.GetLink("ProductListPage").PageId : 0;
34 bool showTotal = Model.Item.GetBoolean("ShowTotal");
35 bool showRemoveAllLinesWithErrorsButton = Model.Item.GetBoolean("ShowRemoveAllLinesWithErrorsButton");
36 string productDetailsPageUrl = productListPageLink > 0 ? $"<a href='{SearchEngineFriendlyURLs.GetFriendlyUrl(productListPageLink)}?ProductId=[ProductId]' target='_blank'>[ProductNumber]</a>" : "";
37 string zeroPriceBehavior = Model.Item.GetString("ZeroPriceBehavior");
38 string[] indexQuery = Pageview.CurrentParagraph.ModuleProperties.GetValue("IndexQuery").Split(new[] {'/'}, StringSplitOptions.RemoveEmptyEntries);
39 string queryName = indexQuery.Length > 0 && !string.IsNullOrEmpty(indexQuery[indexQuery.Length - 1]) ? indexQuery[indexQuery.Length - 1].Replace(".query", "") : "Products";
40 string repositoryName = indexQuery.Length > 0 && !string.IsNullOrEmpty(indexQuery[indexQuery.Length - 2]) ? indexQuery[indexQuery.Length - 2] : "SwiftProducts";
41 bool isLazyLoadingForProductInfoEnabled = Dynamicweb.Core.Converter.ToBoolean(Dynamicweb.Context.Current.Items["IsLazyLoadingForProductInfoEnabled"]);
42 WriteLiteral("\r\n<div");
43 BeginWriteAttribute("class", " class=\"", 3908, "\"", 3987, 6);
44 WriteAttributeValue("", 3916, "grid", 3916, 4, true);
45 WriteAttributeValue(" ", 3920, "gap-0", 3921, 6, true);
46 WriteAttributeValue(" ", 3926, "min-vh-lg-100", 3927, 14, true);
47 WriteAttributeValue(" ", 3940, "h-lg-100", 3941, 9, true);
48 WriteAttributeValue(" ", 3949, "item_", 3950, 6, true);
49 WriteAttributeValue("", 3955, Model.Item.SystemName.ToLower(), 3955, 32, false);
50 EndWriteAttribute();
51 WriteLiteral(@">
52
53 <section class=""g-col-12 g-col-lg-8 p-3 p-lg-5 d-flex flex-column align-content-stretch order-last order-lg-first position-relative"">
54
55 <header class=""d-flex flex-grow-0 pb-3 pb-lg-0"">
56 <div class=""flex-fill"">
57 <h1 class=""h3"">");
58 Write(Model.Header);
59 WriteLiteral("</h1>\r\n \t</div>\r\n \t<div class=\"d-flex align-items-start gap-2\">\r\n \t\t<a");
60 BeginWriteAttribute("href", " href=\"", 4361, "\"", 4397, 2);
61 WriteAttributeValue("", 4368, "/Default.aspx?id=", 4368, 17, true);
62 WriteAttributeValue("", 4385, frontPageId, 4385, 12, false);
63 EndWriteAttribute();
64 WriteLiteral(" class=\"btn btn-link pe-0\">\r\n \t\t\t<div class=\"d-flex gap-2 align-items-center lh-base\">\r\n \t\t\t\t<span class=\"icon-2\">\r\n \t\t\t\t\t");
65 Write(ReadFile(iconPath + "arrow-left.svg"));
66 WriteLiteral("\r\n \t\t\t\t</span>\r\n \t\t\t\t<span>");
67 Write(Translate("Leave"));
68 WriteLiteral("</span>\r\n \t\t\t</div>\r\n \t\t</a>\r\n \t</div>\r\n </header>\r\n\t\t\r\n\t\t<div class=\"d-flex flex-grow-0 pb-3 pb-lg-0\">\r\n \t<div class=\"flex-fill\">\r\n \t\t<p class=\"mb-0\">");
69 Write(Model.Item.GetString("IntroText"));
70 WriteLiteral("</p>\r\n \t</div>\r\n");
71 if (Model.Item.GetBoolean("EnableExcelUpload"))
72 {
73 WriteLiteral(" \t\t<div class=\"d-flex align-items-start gap-2\">\r\n \t\t\t<button type=\"button\" class=\"btn btn-primary w-100 d-flex\" data-bs-toggle=\"modal\" data-bs-target=\"#excelUploadModal\">\r\n \t\t\t\t<span class=\"flex-fill text-start\">\r\n \t\t\t\t\t");
74 Write(Translate("Import from Excel"));
75 WriteLiteral("\r\n \t\t\t\t</span>\r\n \t\t\t</button>\r\n \t\t</div>\r\n");
76 }
77 WriteLiteral(" </div>\r\n \r\n");
78 if (Model.Item.GetBoolean("EnableExcelUpload"))
79 {
80 WriteLiteral(@" <div class=""modal"" id=""excelUploadModal"" tabindex=""-1"" role=""dialog"" aria-labelledby=""exampleModalLongTitle"" aria-hidden=""true"">
81 <div class=""modal-dialog modal-lg modal-dialog-centered"" role=""document"">
82 <div class=""modal-content"">
83 <div class=""modal-header"">
84 <h5 class=""modal-title"" id=""exampleModalLongTitle"">");
85 Write(Translate("Import from Excel"));
86 WriteLiteral("</h5>\r\n \t\t\t\t\t<button type=\"button\" class=\"close\" data-bs-dismiss=\"modal\"");
87 BeginWriteAttribute("aria-label", " aria-label=\"", 5883, "\"", 5915, 1);
88 WriteAttributeValue("", 5896, Translate("Close"), 5896, 19, false);
89 EndWriteAttribute();
90 WriteLiteral(">\r\n \t\t\t\t\t\t<span aria-hidden=\"true\">×</span>\r\n \t\t\t\t\t</button>\r\n \t\t\t\t</div>\r\n \t\t\t\t<div class=\"modal-body\">\r\n \t\t\t\t\t");
91 Write(GetExcelUploadInstructions());
92 WriteLiteral("\r\n \t\t\t\t\t<form");
93 BeginWriteAttribute("action", " action=\"", 6118, "\"", 6194, 2);
94 WriteAttributeValue("", 6127, Dna.SwiftRizzo.QuickOrder.WebAPI.Constants.RoutePrefix, 6127, 55, false);
95 WriteAttributeValue("", 6182, "/exceltojson", 6182, 12, true);
96 EndWriteAttribute();
97 WriteLiteral(" name=\"ExcelFormUpload\" enctype=\"multipart/form-data\" method=\"POST\" data-error-message=\"");
98 Write(Translate("Sorry, there was an error processing your file"));
99 WriteLiteral("\">\r\n \t\t\t\t\t\t<input type=\"hidden\" id=\"importEmptyNegativeZeroQuantityLines\"");
100 BeginWriteAttribute("name", " name=\"", 6423, "\"", 6521, 1);
101 WriteAttributeValue("", 6430, Dna.SwiftRizzo.QuickOrder.WebAPI.Constants.Parameters.ImportEmptyNegativeZeroQuantityLines, 6430, 91, false);
102 EndWriteAttribute();
103 BeginWriteAttribute("value", " value=\"", 6522, "\"", 6605, 1);
104 WriteAttributeValue("", 6530, Model.Item.GetBoolean("ImportEmptyNegativeOrZeroQuantityLines").ToString(), 6530, 75, false);
105 EndWriteAttribute();
106 WriteLiteral(" />\r\n \t\t\t\t\t\t<div class=\"mb-3 form-group\">\r\n \t\t\t\t\t\t\t<label for=\"ExcelFileSelector\" class=\"visually-hidden\">");
107 Write(Translate("Choose file"));
108 WriteLiteral("</label>\r\n \t\t\t\t\t\t\t<input class=\"form-control\" type=\"file\" id=\"ExcelFileSelector\"");
109 BeginWriteAttribute("name", " name=\"", 6838, "\"", 6899, 1);
110 WriteAttributeValue("", 6845, Dna.SwiftRizzo.FileManagement.Constants.FileParameter, 6845, 54, false);
111 EndWriteAttribute();
112 BeginWriteAttribute("placeholder", " placeholder=\"", 6900, "\"", 6939, 1);
113 WriteAttributeValue("", 6914, Translate("Choose file"), 6914, 25, false);
114 EndWriteAttribute();
115 WriteLiteral(@" required=""required"" aria-required=""aria-required"">
116 </div>
117 </form>
118 </div>
119 <div class=""modal-footer"">
120 <button id=""QuickOrderCancelButton"" type=""button"" class=""btn btn-secondary"" data-bs-dismiss=""modal"">");
121 Write(Translate("Cancel"));
122 WriteLiteral("</button>\r\n \t\t\t\t\t<button id=\"QuickOrderUploadButton\" type=\"button\" class=\"btn btn-primary\" onclick=\"QuickOrder.UploadExcelFile()\">");
123 Write(Translate("Upload file"));
124 WriteLiteral("</button>\r\n \t\t\t\t</div>\r\n \t\t\t</div>\r\n \t\t</div>\r\n \t</div>\r\n");
125 }
126 WriteLiteral(" \r\n <form");
127 BeginWriteAttribute("action", " action=\"", 7511, "\"", 7574, 1);
128 WriteAttributeValue("", 7520, SearchEngineFriendlyURLs.GetFriendlyUrl(Model.PageID), 7520, 54, false);
129 EndWriteAttribute();
130 WriteLiteral(" name=\"QuickOrderForm\" data-preloader=\"inline\" method=\"post\"\r\n data-user=\"");
131 Write(userId);
132 WriteLiteral("\"\r\n data-language=\"");
133 Write(Pageview.Area.EcomLanguageId);
134 WriteLiteral("\"\r\n data-currency=\"");
135 Write(Pageview.Area.EcomCurrencyId);
136 WriteLiteral("\"\r\n data-country=\"");
137 Write(Pageview.Area.EcomCountryCode);
138 WriteLiteral("\"\r\n data-shop=\"");
139 Write(Pageview.Area.EcomShopId);
140 WriteLiteral("\" data-field-errors=\"");
141 Write(Translate("Some of your products have errors."));
142 WriteLiteral("\" data-no-products=\"");
143 Write(Translate("Please search for a product."));
144 WriteLiteral("\"\r\n data-product-list-page-link=\"");
145 Write(productDetailsPageUrl);
146 WriteLiteral("\"\r\n data-zero-price-behavior=\"");
147 Write(zeroPriceBehavior);
148 WriteLiteral("\"\r\n data-repository-name=\"");
149 Write(repositoryName);
150 WriteLiteral("\"\r\n data-query-name=\"");
151 Write(queryName);
152 WriteLiteral("\">\r\n \t\r\n <input type=\"hidden\" name=\"redirect\" value=\"false\" />\r\n <input type=\"hidden\" name=\"cartcmd\" value=\"addmulti\" />\r\n <input type=\"hidden\" name=\"quoteCheckoutPageLink\"");
153 BeginWriteAttribute("value", " value=\"", 8475, "\"", 8505, 1);
154 WriteAttributeValue("", 8483, quoteCheckoutPageLink, 8483, 22, false);
155 EndWriteAttribute();
156 WriteLiteral(" />\r\n <input type=\"hidden\" id=\"prePopulateWithProductMinQuantity\"");
157 BeginWriteAttribute("value", " value=\"", 8582, "\"", 8624, 1);
158 WriteAttributeValue("", 8590, prePopulateWithProductMinQuantity, 8590, 34, false);
159 EndWriteAttribute();
160 WriteLiteral(" />\r\n <input type=\"hidden\" id=\"showTotal\"");
161 BeginWriteAttribute("value", " value=\"", 8677, "\"", 8706, 1);
162 WriteAttributeValue("", 8685, showTotal.ToString(), 8685, 21, false);
163 EndWriteAttribute();
164 WriteLiteral(" />\r\n <input type=\"hidden\" id=\"showRemoveAllLinesWithErrorsButton\"");
165 BeginWriteAttribute("value", " value=\"", 8784, "\"", 8838, 1);
166 WriteAttributeValue("", 8792, showRemoveAllLinesWithErrorsButton.ToString(), 8792, 46, false);
167 EndWriteAttribute();
168 WriteLiteral(" />\r\n");
169 if (isLazyLoadingForProductInfoEnabled)
170 {
171 WriteLiteral(" <input type=\"hidden\" name=\"getproductinfo\" value=\"true\" />\r\n");
172 }
173 WriteLiteral(" \r\n \t<div class=\"theme py-3 py-lg-4 w-100\">\r\n \t\t<div class=\"grid grid-11 gap-3 mb-3\">\r\n \t\t\t<div class=\"g-col-4\">");
174 Write(Translate("Product"));
175 WriteLiteral("</div>\r\n \t\t\t<div class=\"g-col-2\">");
176 Write(Translate("Quantity"));
177 WriteLiteral("</div>\r\n \t\t\t<div class=\"g-col-2\">");
178 Write(Translate("Product number"));
179 WriteLiteral("</div>\r\n \t\t\t<div class=\"g-col-2\">");
180 Write(Translate("Unit price"));
181 WriteLiteral("</div>\r\n \t\t\t<div class=\"g-col-1\"></div>\r\n \t\t</div>\r\n \t\t\r\n");
182 if (showTotal)
183 {
184 WriteLiteral(" \t\t\t<div class=\"grid grid-11 gap-3 mb-3\" id=\"quickAddTotals\">\r\n \t\t\t\t<div class=\"g-col-4 fw-bold text-end\">");
185 Write(Translate("Total"));
186 WriteLiteral("</div>\r\n \t\t\t\t<div class=\"g-col-2 fw-bold\" id=\"quickAddTotalsQuantity\">0</div>\r\n \t\t\t\t<div class=\"g-col-2\"></div>\r\n \t\t\t\t<div class=\"g-col-2 fw-bold\">");
187 Write(Dynamicweb.Ecommerce.Common.Context.Currency.Symbol);
188 WriteLiteral("<span id=\"quickAddTotalsPrice\">0.00</span></div>\r\n \t\t\t\t<div class=\"g-col-1\"></div>\r\n \t\t\t</div>\r\n");
189 }
190 WriteLiteral(" \r\n \t\t<div class=\"d-flex justify-content-end py-3 g-col-12 theme\" style=\"box-shadow: 0 -10px 10px -12px var(--bs-gray-300);\">\r\n");
191 if (showRemoveAllLinesWithErrorsButton)
192 {
193 WriteLiteral(" \t\t\t\t<button type=\"button\" id=\"QuickOrderRemoveAllLinesWithErrors\" class=\"btn btn-primary me-2 d-none\" onclick=\"QuickOrder.RemoveAllLinesWithErrors()\">\r\n \t\t\t\t\t<div class=\"d-flex gap-2 align-items-center lh-base\">\r\n \t\t\t\t\t\t<span>");
194 Write(Translate("Remove all lines with errors"));
195 WriteLiteral("</span>\r\n \t\t\t\t\t\t<span class=\"icon-2\">\r\n \t\t\t\t\t\t\t");
196 Write(ReadFile("/Files/Templates/Designs/Swift/Assets/icons/trash.svg"));
197 WriteLiteral("\r\n \t\t\t\t\t\t</span>\r\n \t\t\t\t\t</div>\r\n \t\t\t\t</button>\r\n");
198 }
199 WriteLiteral(" \t\t\t<button type=\"button\" id=\"QuickOrderAddToCart\" class=\"btn btn-primary\" onclick=\"QuickOrder.AddToCart(event);\">\r\n \t\t\t\t<div class=\"d-flex gap-2 align-items-center lh-base\">\r\n \t\t\t\t\t<span>");
200 Write(Translate("Add all to cart"));
201 WriteLiteral("</span>\r\n \t\t\t\t\t<span class=\"icon-2\">\r\n \t\t\t\t\t\t");
202 Write(ReadFile(iconPath + "shopping-cart.svg"));
203 WriteLiteral(@"
204 </span>
205 </div>
206 </button>
207 </div>
208 </div>
209 </form>
210
211 <form action=""/Default.aspx"" method=""post"" id=""QuickOrderCartForm"" data-layout-template=""Swift_CartSummary.cshtml"" data-response-target-element=""CartSummaryContainer"">
212 <input type=""hidden"" name=""ID""");
213 BeginWriteAttribute("value", " value=\"", 11349, "\"", 11370, 1);
214 WriteAttributeValue("", 11357, Model.PageID, 11357, 13, false);
215 EndWriteAttribute();
216 WriteLiteral(" />\r\n \t<input type=\"hidden\" name=\"redirect\" value=\"false\" />\r\n \t<input type=\"hidden\" name=\"checkoutUrl\"");
217 BeginWriteAttribute("value", " value=\"", 11488, "\"", 11508, 1);
218 WriteAttributeValue("", 11496, checkoutUrl, 11496, 12, false);
219 EndWriteAttribute();
220 WriteLiteral(" />\r\n </form>\r\n \r\n\t</section>\r\n\r\n\t<aside");
221 BeginWriteAttribute("class", " class=\"", 11563, "\"", 11625, 5);
222 WriteAttributeValue("", 11571, "g-col-12", 11571, 8, true);
223 WriteAttributeValue(" ", 11579, "g-col-lg-4", 11580, 11, true);
224 WriteAttributeValue(" ", 11590, "order-first", 11591, 12, true);
225 WriteAttributeValue(" ", 11602, "order-lg-last", 11603, 14, true);
226 WriteAttributeValue(" ", 11616, theme, 11617, 8, false);
227 EndWriteAttribute();
228 WriteLiteral(">\r\n\r\n\t\t<div class=\"h-100 p-3 p-lg-5\">\r\n");
229 if(!Pageview.IsVisualEditorMode)
230 {
231
232 WriteLiteral("\t\t\t\t<div id=\"CartSummaryContainer\">\r\n");
233 WriteLiteral("\t\t\t\t</div>\r\n");
234 WriteLiteral("\t\t\t\t<script type=\"module\">\r\n\t\t\t\t\twindow.addEventListener(\'load\', (event) => {\r\n\t\t\t\t\t\tswift.PageUpdater.Update(document.querySelector(\"#QuickOrderCartForm\"));\r\n\t\t\t\t\t});\r\n\t\t\t\t</script>\r\n");
235 }
236 else
237 {
238 WriteLiteral("\t\t\t\t<div class=\"alert alert-info\" role=\"alert\">\r\n\t\t\t\t\t<span>");
239 Write(Translate("Cart Summary"));
240 WriteLiteral("</span>\r\n\t\t\t\t</div>\r\n");
241 }
242 WriteLiteral("\t\t</div>\r\n\r\n\t</aside>\r\n\r\n</div>\r\n\r\n<div");
243 BeginWriteAttribute("class", " class=\"", 12209, "\"", 12259, 5);
244 WriteAttributeValue("", 12217, "position-fixed", 12217, 14, true);
245 WriteAttributeValue(" ", 12231, "bottom-0", 12232, 9, true);
246 WriteAttributeValue(" ", 12240, "end-0", 12241, 6, true);
247 WriteAttributeValue(" ", 12246, "p-3", 12247, 4, true);
248 WriteAttributeValue(" ", 12250, theme, 12251, 8, false);
249 EndWriteAttribute();
250 WriteLiteral(" style=\"z-index: 1040\">\r\n\t<div id=\"quickOrderToast\" class=\"toast fade border-0 theme light\" role=\"alert\" aria-live=\"assertive\" aria-atomic=\"true\">\r\n\t\t<div class=\"toast-header\">\r\n\t\t\t<strong class=\"me-auto\">");
251 Write(Translate("Upload Completed!"));
252 WriteLiteral("</strong>\r\n\t\t\t<button type=\"button\" class=\"btn-close\" data-bs-dismiss=\"toast\" aria-label=\"Close\"></button>\r\n\t\t</div>\r\n\t\t<div class=\"toast-body\">\r\n\t\t\t");
253 Write(Translate("Excel upload completed"));
254 WriteLiteral(@"
255 </div>
256 </div>
257 </div>
258
259 <script type=""module"" src=""/Files/Templates/Designs/Swift/Assets/js/rizzo/sr-quickOrder-min.js""></script>
260 <script>
261 window.addEventListener('load', function (event) {
262 QuickOrder.Init();
263 });
264 </script>
265
266 <script id=""ProductLineTemplate"" type=""text/html"">
267 <div class=""grid grid-11 gap-3 mb-3 js-productLine"" id=""ProductLine[counter]"" data-counter=""[counter]"">
268 <input type=""hidden"" id=""ProductLoopCounter[counter]"" name=""ProductLoopCounter[counter]"" value=""[counter]"" />
269 <input type=""hidden"" id=""ProductId[counter]"" name=""ProductId[counter]""");
270 BeginWriteAttribute("value", " value=\"", 13269, "\"", 13277, 0);
271 EndWriteAttribute();
272 WriteLiteral(" data-counter=\"[counter]\"/>\r\n\t\t<input type=\"hidden\" id=\"VariantID[counter]\" name=\"VariantID[counter]\"");
273 BeginWriteAttribute("value", " value=\"", 13379, "\"", 13387, 0);
274 EndWriteAttribute();
275 WriteLiteral(" />\r\n\t\t<input type=\"hidden\" id=\"UnitID[counter]\" name=\"UnitID[counter]\"");
276 BeginWriteAttribute("value", " value=\"", 13459, "\"", 13467, 0);
277 EndWriteAttribute();
278 WriteLiteral(" />\r\n\t\t<div class=\"g-col-4 form-group dropdown type-ahead-dropdown align-self-center\" id=\"ProductSearchContainer[counter]\">\r\n\t\t\t<label for=\"ProductSearch[counter]\" class=\"visually-hidden\">");
279 Write(Translate("Product"));
280 WriteLiteral("</label>\r\n\t\t\t<input id=\"ProductSearch[counter]\"\r\n\t\t\t class=\"form-control js-product\"\r\n\t\t\t type=\"search\"");
281 BeginWriteAttribute("placeholder", "\r\n\t\t\t placeholder=\"", 13792, "\"", 13842, 1);
282 WriteAttributeValue("", 13817, Translate("Search here"), 13817, 25, false);
283 EndWriteAttribute();
284 WriteLiteral("\r\n\t\t\t autocomplete=\"off\"\r\n\t\t\t maxlength=\"255\"\r\n\t\t\t name=\"q\"");
285 BeginWriteAttribute("value", "\r\n\t\t\t value=\"", 13920, "\"", 13939, 0);
286 EndWriteAttribute();
287 WriteLiteral(@"
288 onchange=""QuickOrder.HandleProductChange(this.value, '[counter]')""
289 onkeydown=""QuickOrder.HandleKeyboardInSearch(this, event)""
290 onfocus=""QuickOrder.ShowSearchResultsContainer('[counter]')""
291 onblur=""QuickOrder.HandleSearchResultsContainer('[counter]')""
292 data-counter=""[counter]""/>
293 <ul id=""ProductResults[counter]"" class=""dropdown-menu type-ahead-menu w-100 d-none"" data-counter=""[counter]""></ul>
294 </div>
295 <div class=""g-col-2 form-group align-self-center"">
296 <label for=""Quantity[counter]"" class=""visually-hidden"">");
297 Write(Translate("Quantity"));
298 WriteLiteral(@"</label>
299 <input id=""Quantity[counter]"" disabled=""true"" name=""Quantity[counter]"" min=""1"" type=""number"" onchange=""QuickOrder.ChangeQuantity(this,'[counter]')"" class=""form-control js-quantity-input""/>
300 </div>
301 <div class=""g-col-2 align-self-center"">
302 <span id=""ProductNumber[counter]"" class=""d-block d-none quick-order-item--text""></span>
303 </div>
304 <div class=""g-col-2 align-self-center"">
305 <span id=""PriceDisplay[counter]"" class=""d-block d-none quick-order-item--text""></span>
306 </div>
307 <div class=""g-col-1 align-self-center"">
308 <div class=""d-flex justify-content-end"">
309 <button type=""button"" class=""btn btn-secondary d-none"" id=""DeleteButton[counter]""");
310 BeginWriteAttribute("title", " title=\"", 15211, "\"", 15247, 1);
311 WriteAttributeValue("", 15219, Translate("Remove Product"), 15219, 28, false);
312 EndWriteAttribute();
313 WriteLiteral(" onclick=\"QuickOrder.DeleteLine(\'[counter]\')\">\r\n\t\t\t\t\t");
314 Write(ReadFile("/Files/Templates/Designs/Swift/Assets/icons/trash.svg"));
315 WriteLiteral("\r\n\t\t\t\t</button>\r\n\t\t\t\t<button type=\"button\" class=\"btn btn-secondary d-none\" id=\"ClearButton[counter]\"");
316 BeginWriteAttribute("title", " title=\"", 15468, "\"", 15495, 1);
317 WriteAttributeValue("", 15476, Translate("Clear"), 15476, 19, false);
318 EndWriteAttribute();
319 WriteLiteral(" onclick=\"QuickOrder.ClearLine(\'[counter]\')\">\r\n\t\t\t\t\t");
320 Write(ReadFile("/Files/Templates/Designs/Swift/Assets/icons/x.svg"));
321 WriteLiteral(@"
322 </button>
323 </div>
324 </div>
325 </div>
326 </script>
327
328 <script id=""ProductSearchLineTemplate"" type=""text/html"">
329 <li class=""dropdown-item px-2 text-wrap""
330 onclick='QuickOrder.GetProductInfo([productInfo], [counter])'
331 onblur=""QuickOrder.HandleSearchResultsContainer('[counter]')"">
332 <span class=""flex-fill text-break"">[productName] - [productNumber]</span>
333 </li>
334 </script>
335
336 <style>
337 .quick-order-item--text {
338 line-height: 38px;
339 }
340 </style>
341 ");
342 }
343 #pragma warning restore 1998
344
345 private string GetExcelUploadInstructions()
346 {
347 const string downloadTemplateTag = "{{DownloadTemplate}}";
348
349 string excelUploadInstructions = Model.Item.GetString("ExcelUploadInstructions");
350 string downloadTemplateText = Model.Item.GetString("DownloadTemplateText");
351 string downloadTemplateDefaultFile = Model.Item.GetString("DownloadTemplateDefaultFile");
352 string downloadTemplateFolder = Model.Item.GetString("DownloadTemplateFolder");
353
354 if (excelUploadInstructions.Contains(downloadTemplateTag))
355 {
356 bool customerFileExists = false;
357
358 if (Pageview.User != null && downloadTemplateFolder != "/Files/")
359 {
360 var folderPath = Context.Current.Server.MapPath(downloadTemplateFolder);
361 var fileNameWithPath = Pageview.User.CustomerNumber != "" ? $"{folderPath}\\{Pageview.User.CustomerNumber}.xlsx" : "";
362
363 customerFileExists = fileNameWithPath != "" && File.Exists(fileNameWithPath);
364 }
365
366 string fileUrl = customerFileExists ? $"{downloadTemplateFolder}//{Pageview.User.CustomerNumber}.xlsx" : downloadTemplateDefaultFile != "" ? downloadTemplateDefaultFile : "";
367
368 excelUploadInstructions = fileUrl != "" ? excelUploadInstructions.Replace(downloadTemplateTag, "<a href='" + fileUrl + "' data-mce-href='" + fileUrl + "' data-mce-selected='inline-boundary'>" + downloadTemplateText + "</a>") : excelUploadInstructions;
369 }
370
371 return excelUploadInstructions;
372 }
373 }
374 }
375 #pragma warning restore 1591
376
1 @using Dynamicweb
2 @using Dynamicweb.Frontend
3 @using System.IO
4 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.ParagraphViewModel>
5
6 @functions
7 {
8 private string GetExcelUploadInstructions()
9 {
10 const string downloadTemplateTag = "{{DownloadTemplate}}";
11
12 string excelUploadInstructions = Model.Item.GetString("ExcelUploadInstructions");
13 string downloadTemplateText = Model.Item.GetString("DownloadTemplateText");
14 string downloadTemplateDefaultFile = Model.Item.GetString("DownloadTemplateDefaultFile");
15 string downloadTemplateFolder = Model.Item.GetString("DownloadTemplateFolder");
16
17 if (excelUploadInstructions.Contains(downloadTemplateTag))
18 {
19 bool customerFileExists = false;
20
21 if (Pageview.User != null && downloadTemplateFolder != "/Files/")
22 {
23 var folderPath = Context.Current.Server.MapPath(downloadTemplateFolder);
24 var fileNameWithPath = Pageview.User.CustomerNumber != "" ? $"{folderPath}\\{Pageview.User.CustomerNumber}.xlsx" : "";
25
26 customerFileExists = fileNameWithPath != "" && File.Exists(fileNameWithPath);
27 }
28
29 string fileUrl = customerFileExists ? $"{downloadTemplateFolder}//{Pageview.User.CustomerNumber}.xlsx" : downloadTemplateDefaultFile != "" ? downloadTemplateDefaultFile : "";
30
31 excelUploadInstructions = fileUrl != "" ? excelUploadInstructions.Replace(downloadTemplateTag, "<a href='" + fileUrl + "' data-mce-href='" + fileUrl + "' data-mce-selected='inline-boundary'>" + downloadTemplateText + "</a>") : excelUploadInstructions;
32 }
33
34 return excelUploadInstructions;
35 }
36 }
37
38 @{
39 string theme = !string.IsNullOrWhiteSpace(Model.Item.GetRawValueString("Theme")) ? " theme " + Model.Item.GetRawValueString("Theme").Replace(" ", "").Trim().ToLower() : "";
40 int frontPageId = Dynamicweb.Content.Services.Pages.GetFirstPageForArea(Pageview.AreaID).ID;
41 string iconPath = "/Files/Templates/Designs/Swift/Assets/icons/";
42
43 LinkViewModel checkoutAnonymousPageId = Model.Item.GetLink("CheckoutAnonymousPageLink");
44 string checkoutAnonymousPageUrl = checkoutAnonymousPageId?.Url;
45 LinkViewModel checkoutUserPageId = Model.Item.GetLink("CheckoutUserPageLink");
46 string checkoutUserPageUrl = checkoutUserPageId?.Url;
47 string checkoutUrl = Pageview.User == null ? checkoutAnonymousPageUrl : checkoutUserPageUrl;
48 string userId = Pageview.User != null ? Dynamicweb.Core.Converter.ToString(Pageview.User.ID) : string.Empty;
49 string prePopulateWithProductMinQuantity = Model.Item.GetBoolean("PrePopulateWithProductMinimumQuantity").ToString();
50 int quoteCheckoutPageLink = Model.Item?.GetLink("QuoteCheckoutPageLink") != null ? Model.Item.GetLink("QuoteCheckoutPageLink").PageId : 0;
51 int productListPageLink = Model.Item?.GetLink("ProductListPage") != null ? Model.Item.GetLink("ProductListPage").PageId : 0;
52 bool showTotal = Model.Item.GetBoolean("ShowTotal");
53 bool showRemoveAllLinesWithErrorsButton = Model.Item.GetBoolean("ShowRemoveAllLinesWithErrorsButton");
54 string productDetailsPageUrl = productListPageLink > 0 ? $"<a href='{SearchEngineFriendlyURLs.GetFriendlyUrl(productListPageLink)}?ProductId=[ProductId]' target='_blank'>[ProductNumber]</a>" : "";
55 string zeroPriceBehavior = Model.Item.GetString("ZeroPriceBehavior");
56 string[] indexQuery = Pageview.CurrentParagraph.ModuleProperties.GetValue("IndexQuery").Split(new[] {'/'}, StringSplitOptions.RemoveEmptyEntries);
57 string queryName = indexQuery.Length > 0 && !string.IsNullOrEmpty(indexQuery[indexQuery.Length - 1]) ? indexQuery[indexQuery.Length - 1].Replace(".query", "") : "Products";
58 string repositoryName = indexQuery.Length > 0 && !string.IsNullOrEmpty(indexQuery[indexQuery.Length - 2]) ? indexQuery[indexQuery.Length - 2] : "SwiftProducts";
59 bool isLazyLoadingForProductInfoEnabled = Dynamicweb.Core.Converter.ToBoolean(Dynamicweb.Context.Current.Items["IsLazyLoadingForProductInfoEnabled"]);
60 }
61
62 <div class="grid gap-0 min-vh-lg-100 h-lg-100 item_@Model.Item.SystemName.ToLower()">
63
64 <section class="g-col-12 g-col-lg-8 p-3 p-lg-5 d-flex flex-column align-content-stretch order-last order-lg-first position-relative">
65
66 <header class="d-flex flex-grow-0 pb-3 pb-lg-0">
67 <div class="flex-fill">
68 <h1 class="h3">@Model.Header</h1>
69 </div>
70 <div class="d-flex align-items-start gap-2">
71 <a href="/Default.aspx?id=@frontPageId" class="btn btn-link pe-0">
72 <div class="d-flex gap-2 align-items-center lh-base">
73 <span class="icon-2">
74 @ReadFile(iconPath + "arrow-left.svg")
75 </span>
76 <span>@Translate("Leave")</span>
77 </div>
78 </a>
79 </div>
80 </header>
81
82 <div class="d-flex flex-grow-0 pb-3 pb-lg-0">
83 <div class="flex-fill">
84 <p class="mb-0">@Model.Item.GetString("IntroText")</p>
85 </div>
86 @if (Model.Item.GetBoolean("EnableExcelUpload"))
87 {
88 <div class="d-flex align-items-start gap-2">
89 <button type="button" class="btn btn-primary w-100 d-flex" data-bs-toggle="modal" data-bs-target="#excelUploadModal">
90 <span class="flex-fill text-start">
91 @Translate("Import from Excel")
92 </span>
93 </button>
94 </div>
95 }
96 </div>
97
98 @if (Model.Item.GetBoolean("EnableExcelUpload"))
99 {
100 <div class="modal" id="excelUploadModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLongTitle" aria-hidden="true">
101 <div class="modal-dialog modal-lg modal-dialog-centered" role="document">
102 <div class="modal-content">
103 <div class="modal-header">
104 <h5 class="modal-title" id="exampleModalLongTitle">@Translate("Import from Excel")</h5>
105 <button type="button" class="close" data-bs-dismiss="modal" aria-label="@Translate("Close")">
106 <span aria-hidden="true">×</span>
107 </button>
108 </div>
109 <div class="modal-body">
110 @GetExcelUploadInstructions()
111 <form action="@Dna.SwiftRizzo.QuickOrder.WebAPI.Constants.RoutePrefix/exceltojson" name="ExcelFormUpload" enctype="multipart/form-data" method="POST" data-error-message="@Translate("Sorry, there was an error processing your file")">
112 <input type="hidden" id="importEmptyNegativeZeroQuantityLines" name="@Dna.SwiftRizzo.QuickOrder.WebAPI.Constants.Parameters.ImportEmptyNegativeZeroQuantityLines" value="@Model.Item.GetBoolean("ImportEmptyNegativeOrZeroQuantityLines").ToString()" />
113 <div class="mb-3 form-group">
114 <label for="ExcelFileSelector" class="visually-hidden">@Translate("Choose file")</label>
115 <input class="form-control" type="file" id="ExcelFileSelector" name="@Dna.SwiftRizzo.FileManagement.Constants.FileParameter" placeholder="@Translate("Choose file")" required="required" aria-required="aria-required">
116 </div>
117 </form>
118 </div>
119 <div class="modal-footer">
120 <button id="QuickOrderCancelButton" type="button" class="btn btn-secondary" data-bs-dismiss="modal">@Translate("Cancel")</button>
121 <button id="QuickOrderUploadButton" type="button" class="btn btn-primary" onclick="QuickOrder.UploadExcelFile()">@Translate("Upload file")</button>
122 </div>
123 </div>
124 </div>
125 </div>
126 }
127
128 <form action="@SearchEngineFriendlyURLs.GetFriendlyUrl(Model.PageID)" name="QuickOrderForm" data-preloader="inline" method="post"
129 data-user="@userId"
130 data-language="@Pageview.Area.EcomLanguageId"
131 data-currency="@Pageview.Area.EcomCurrencyId"
132 data-country="@Pageview.Area.EcomCountryCode"
133 data-shop="@Pageview.Area.EcomShopId" data-field-errors="@Translate("Some of your products have errors.")" data-no-products="@Translate("Please search for a product.")"
134 data-product-list-page-link="@productDetailsPageUrl"
135 data-zero-price-behavior="@zeroPriceBehavior"
136 data-repository-name="@repositoryName"
137 data-query-name="@queryName">
138
139 <input type="hidden" name="redirect" value="false" />
140 <input type="hidden" name="cartcmd" value="addmulti" />
141 <input type="hidden" name="quoteCheckoutPageLink" value="@quoteCheckoutPageLink" />
142 <input type="hidden" id="prePopulateWithProductMinQuantity" value="@prePopulateWithProductMinQuantity" />
143 <input type="hidden" id="showTotal" value="@showTotal.ToString()" />
144 <input type="hidden" id="showRemoveAllLinesWithErrorsButton" value="@showRemoveAllLinesWithErrorsButton.ToString()" />
145 @if (isLazyLoadingForProductInfoEnabled)
146 {
147 <input type="hidden" name="getproductinfo" value="true" />
148 }
149
150 <div class="theme py-3 py-lg-4 w-100">
151 <div class="grid grid-11 gap-3 mb-3">
152 <div class="g-col-4">@Translate("Product")</div>
153 <div class="g-col-2">@Translate("Quantity")</div>
154 <div class="g-col-2">@Translate("Product number")</div>
155 <div class="g-col-2">@Translate("Unit price")</div>
156 <div class="g-col-1"></div>
157 </div>
158
159 @if (showTotal)
160 {
161 <div class="grid grid-11 gap-3 mb-3" id="quickAddTotals">
162 <div class="g-col-4 fw-bold text-end">@Translate("Total")</div>
163 <div class="g-col-2 fw-bold" id="quickAddTotalsQuantity">0</div>
164 <div class="g-col-2"></div>
165 <div class="g-col-2 fw-bold">@Dynamicweb.Ecommerce.Common.Context.Currency.Symbol<span id="quickAddTotalsPrice">0.00</span></div>
166 <div class="g-col-1"></div>
167 </div>
168 }
169
170 <div class="d-flex justify-content-end py-3 g-col-12 theme" style="box-shadow: 0 -10px 10px -12px var(--bs-gray-300);">
171 @if (showRemoveAllLinesWithErrorsButton)
172 {
173 <button type="button" id="QuickOrderRemoveAllLinesWithErrors" class="btn btn-primary me-2 d-none" onclick="QuickOrder.RemoveAllLinesWithErrors()">
174 <div class="d-flex gap-2 align-items-center lh-base">
175 <span>@Translate("Remove all lines with errors")</span>
176 <span class="icon-2">
177 @ReadFile("/Files/Templates/Designs/Swift/Assets/icons/trash.svg")
178 </span>
179 </div>
180 </button>
181 }
182 <button type="button" id="QuickOrderAddToCart" class="btn btn-primary" onclick="QuickOrder.AddToCart(event);">
183 <div class="d-flex gap-2 align-items-center lh-base">
184 <span>@Translate("Add all to cart")</span>
185 <span class="icon-2">
186 @ReadFile(iconPath + "shopping-cart.svg")
187 </span>
188 </div>
189 </button>
190 </div>
191 </div>
192 </form>
193
194 <form action="/Default.aspx" method="post" id="QuickOrderCartForm" data-layout-template="Swift_CartSummary.cshtml" data-response-target-element="CartSummaryContainer">
195 <input type="hidden" name="ID" value="@Model.PageID" />
196 <input type="hidden" name="redirect" value="false" />
197 <input type="hidden" name="checkoutUrl" value="@checkoutUrl" />
198 </form>
199
200 </section>
201
202 <aside class="g-col-12 g-col-lg-4 order-first order-lg-last @(theme)">
203
204 <div class="h-100 p-3 p-lg-5">
205 @if(!Pageview.IsVisualEditorMode)
206 {
207
208 <div id="CartSummaryContainer">
209 @* Initial form for first load (We pass all the settings to the actual template) *@
210 </div>
211
212 <script type="module">
213 window.addEventListener('load', (event) => {
214 swift.PageUpdater.Update(document.querySelector("#QuickOrderCartForm"));
215 });
216 </script>
217 }
218 else
219 {
220 <div class="alert alert-info" role="alert">
221 <span>@Translate("Cart Summary")</span>
222 </div>
223 }
224 </div>
225
226 </aside>
227
228 </div>
229
230 <div class="position-fixed bottom-0 end-0 p-3 @(theme)" style="z-index: 1040">
231 <div id="quickOrderToast" class="toast fade border-0 theme light" role="alert" aria-live="assertive" aria-atomic="true">
232 <div class="toast-header">
233 <strong class="me-auto">@Translate("Upload Completed!")</strong>
234 <button type="button" class="btn-close" data-bs-dismiss="toast" aria-label="Close"></button>
235 </div>
236 <div class="toast-body">
237 @Translate("Excel upload completed")
238 </div>
239 </div>
240 </div>
241
242 <script type="module" src="/Files/Templates/Designs/Swift/Assets/js/rizzo/sr-quickOrder-min.js"></script>
243 <script>
244 window.addEventListener('load', function (event) {
245 QuickOrder.Init();
246 });
247 </script>
248
249 <script id="ProductLineTemplate" type="text/html">
250 <div class="grid grid-11 gap-3 mb-3 js-productLine" id="ProductLine[counter]" data-counter="[counter]">
251 <input type="hidden" id="ProductLoopCounter[counter]" name="ProductLoopCounter[counter]" value="[counter]" />
252 <input type="hidden" id="ProductId[counter]" name="ProductId[counter]" value="" data-counter="[counter]"/>
253 <input type="hidden" id="VariantID[counter]" name="VariantID[counter]" value="" />
254 <input type="hidden" id="UnitID[counter]" name="UnitID[counter]" value="" />
255 <div class="g-col-4 form-group dropdown type-ahead-dropdown align-self-center" id="ProductSearchContainer[counter]">
256 <label for="ProductSearch[counter]" class="visually-hidden">@Translate("Product")</label>
257 <input id="ProductSearch[counter]"
258 class="form-control js-product"
259 type="search"
260 placeholder="@Translate("Search here")"
261 autocomplete="off"
262 maxlength="255"
263 name="q"
264 value=""
265 onchange="QuickOrder.HandleProductChange(this.value, '[counter]')"
266 onkeydown="QuickOrder.HandleKeyboardInSearch(this, event)"
267 onfocus="QuickOrder.ShowSearchResultsContainer('[counter]')"
268 onblur="QuickOrder.HandleSearchResultsContainer('[counter]')"
269 data-counter="[counter]"/>
270 <ul id="ProductResults[counter]" class="dropdown-menu type-ahead-menu w-100 d-none" data-counter="[counter]"></ul>
271 </div>
272 <div class="g-col-2 form-group align-self-center">
273 <label for="Quantity[counter]" class="visually-hidden">@Translate("Quantity")</label>
274 <input id="Quantity[counter]" disabled="true" name="Quantity[counter]" min="1" type="number" onchange="QuickOrder.ChangeQuantity(this,'[counter]')" class="form-control js-quantity-input"/>
275 </div>
276 <div class="g-col-2 align-self-center">
277 <span id="ProductNumber[counter]" class="d-block d-none quick-order-item--text"></span>
278 </div>
279 <div class="g-col-2 align-self-center">
280 <span id="PriceDisplay[counter]" class="d-block d-none quick-order-item--text"></span>
281 </div>
282 <div class="g-col-1 align-self-center">
283 <div class="d-flex justify-content-end">
284 <button type="button" class="btn btn-secondary d-none" id="DeleteButton[counter]" title="@Translate("Remove Product")" onclick="QuickOrder.DeleteLine('[counter]')">
285 @ReadFile("/Files/Templates/Designs/Swift/Assets/icons/trash.svg")
286 </button>
287 <button type="button" class="btn btn-secondary d-none" id="ClearButton[counter]" title="@Translate("Clear")" onclick="QuickOrder.ClearLine('[counter]')">
288 @ReadFile("/Files/Templates/Designs/Swift/Assets/icons/x.svg")
289 </button>
290 </div>
291 </div>
292 </div>
293 </script>
294
295 <script id="ProductSearchLineTemplate" type="text/html">
296 <li class="dropdown-item px-2 text-wrap"
297 onclick='QuickOrder.GetProductInfo([productInfo], [counter])'
298 onblur="QuickOrder.HandleSearchResultsContainer('[counter]')">
299 <span class="flex-fill text-break">[productName] - [productNumber]</span>
300 </li>
301 </script>
302
303 <style>
304 .quick-order-item--text {
305 line-height: 38px;
306 }
307 </style>
308