Error compiling template "Designs/Swift/Paragraph/DiscountExplanation.cshtml" Line 147: The name 'lang' does not exist in the current context
1 //------------------------------------------------------------------------------ 2 // <auto-generated> 3 // This code was generated by a tool. 4 // Runtime Version:4.0.30319.42000 5 // 6 // Changes to this file may cause incorrect behavior and will be lost if 7 // the code is regenerated. 8 // </auto-generated> 9 //------------------------------------------------------------------------------ 10 11 namespace CompiledRazorTemplates.Dynamic { 12 using System; 13 using System.Collections.Generic; 14 using System.Linq; 15 16 #line 2 "D:\dynamicweb.net\Solutions\nextech\Superhome.swiftstaging.dynamicweb-cms.com\files\Templates\Designs\Swift\Paragraph\DiscountExplanation.cshtml" 17 using Dynamicweb.Ecommerce.ProductCatalog; 18 19 #line default 20 #line hidden 21 22 23 public class RazorEngine_22eb30b5ced14e0cb348dc1b40e19b87 : Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.ParagraphViewModel> { 24 25 #line hidden 26 27 public RazorEngine_22eb30b5ced14e0cb348dc1b40e19b87() { 28 } 29 30 public override void Execute() { 31 WriteLiteral("\r\n"); 32 33 34 #line 4 "D:\dynamicweb.net\Solutions\nextech\Superhome.swiftstaging.dynamicweb-cms.com\files\Templates\Designs\Swift\Paragraph\DiscountExplanation.cshtml" 35 36 ProductViewModel product = null; 37 if (Dynamicweb.Context.Current.Items.Contains("ProductDetails")) 38 { 39 product = (ProductViewModel)Dynamicweb.Context.Current.Items["ProductDetails"]; 40 } 41 else if (Pageview.Page.Item["DummyProduct"] != null && Pageview.IsVisualEditorMode) 42 { 43 var pageViewModel = Dynamicweb.Frontend.ContentViewModelFactory.CreatePageInfoViewModel(Pageview.Page); 44 ProductListViewModel productList = pageViewModel.Item.GetValue("DummyProduct") != null ? pageViewModel.Item.GetValue("DummyProduct") as ProductListViewModel : new ProductListViewModel(); 45 46 if (productList?.Products is object) 47 { 48 product = productList.Products[0]; 49 } 50 } 51 52 53 54 //CS NT.. 55 56 string DiscountExplanation_Text = "";//"Buy 30 euros worth of products and get this for"; 57 string DiscountExplanation_percentage = "";//"€ 5.25"; 58 59 string DiscountExplanation = ""; 60 foreach (var p in product.ProductFields) 61 { 62 if (p.Key == "DiscountExplanation" && p.Value != null && !string.IsNullOrWhiteSpace(p.Value.ToString())) 63 { 64 DiscountExplanation = p.Value.ToString(); 65 DiscountExplanation = DiscountExplanation.Trim().Replace("±","€").Replace("�","€"); 66 // split based on $ character DiscountExplanation_Text 67 var DiscountExplanation_Unsplitted = DiscountExplanation.Split("$".ToCharArray()); 68 if (DiscountExplanation_Unsplitted.Length == 2) 69 { 70 if (!string.IsNullOrWhiteSpace(DiscountExplanation_Unsplitted[0])) 71 { 72 DiscountExplanation_Text = DiscountExplanation_Unsplitted[0]; 73 } 74 if (!string.IsNullOrWhiteSpace(DiscountExplanation_Unsplitted[1])) 75 { 76 DiscountExplanation_percentage = DiscountExplanation_Unsplitted[1]; 77 } 78 DiscountExplanation_Text = Pageview.Area.CultureInfo.TwoLetterISOLanguageName == "el" ? Translate(DiscountExplanation_Text.Replace("+"," ")) : DiscountExplanation_Text; 79 DiscountExplanation_Text += " <span class='discountExplanationPercentage_Span'>€" + DiscountExplanation_percentage + "</span>"; 80 } 81 else 82 { 83 DiscountExplanation_Text = DiscountExplanation; 84 } 85 break; 86 } 87 } 88 89 90 91 92 93 #line default 94 #line hidden 95 WriteLiteral("\r\n\r\n\r\n"); 96 97 98 #line 63 "D:\dynamicweb.net\Solutions\nextech\Superhome.swiftstaging.dynamicweb-cms.com\files\Templates\Designs\Swift\Paragraph\DiscountExplanation.cshtml" 99 if (product is object) 100 { 101 string fontsize_style = "font-size:" + Model.Item.GetRawValueString("Font_Size", "12px") + ";"; 102 103 104 105 #line default 106 #line hidden 107 WriteLiteral(" <div"); 108 109 WriteLiteral(" class=\"DiscountExplanation_Container\""); 110 111 WriteLiteral(">\r\n"); 112 113 114 #line 68 "D:\dynamicweb.net\Solutions\nextech\Superhome.swiftstaging.dynamicweb-cms.com\files\Templates\Designs\Swift\Paragraph\DiscountExplanation.cshtml" 115 116 117 #line default 118 #line hidden 119 120 #line 68 "D:\dynamicweb.net\Solutions\nextech\Superhome.swiftstaging.dynamicweb-cms.com\files\Templates\Designs\Swift\Paragraph\DiscountExplanation.cshtml" 121 if(!string.IsNullOrWhiteSpace(DiscountExplanation_Text)) 122 { 123 124 125 #line default 126 #line hidden 127 WriteLiteral(" <div"); 128 129 WriteLiteral(" style=\"width:100%\""); 130 131 WriteLiteral(" class=\"DiscountExplanation\""); 132 133 WriteAttribute("style", Tuple.Create(" style=\"", 2817), Tuple.Create("\"", 2840) 134 135 #line 70 "D:\dynamicweb.net\Solutions\nextech\Superhome.swiftstaging.dynamicweb-cms.com\files\Templates\Designs\Swift\Paragraph\DiscountExplanation.cshtml" 136 , Tuple.Create(Tuple.Create("", 2825), Tuple.Create<System.Object, System.Int32>(fontsize_style 137 138 #line default 139 #line hidden 140 , 2825), false) 141 ); 142 143 WriteLiteral(">"); 144 145 146 #line 70 "D:\dynamicweb.net\Solutions\nextech\Superhome.swiftstaging.dynamicweb-cms.com\files\Templates\Designs\Swift\Paragraph\DiscountExplanation.cshtml" 147 Write(lang); 148 149 150 #line default 151 #line hidden 152 WriteLiteral(" "); 153 154 155 #line 70 "D:\dynamicweb.net\Solutions\nextech\Superhome.swiftstaging.dynamicweb-cms.com\files\Templates\Designs\Swift\Paragraph\DiscountExplanation.cshtml" 156 Write(DiscountExplanation_Text); 157 158 159 #line default 160 #line hidden 161 WriteLiteral("</div>\r\n"); 162 163 164 #line 71 "D:\dynamicweb.net\Solutions\nextech\Superhome.swiftstaging.dynamicweb-cms.com\files\Templates\Designs\Swift\Paragraph\DiscountExplanation.cshtml" 165 } 166 167 168 #line default 169 #line hidden 170 WriteLiteral(" </div>\r\n"); 171 172 173 #line 73 "D:\dynamicweb.net\Solutions\nextech\Superhome.swiftstaging.dynamicweb-cms.com\files\Templates\Designs\Swift\Paragraph\DiscountExplanation.cshtml" 174 } 175 else if (Pageview.IsVisualEditorMode) 176 { 177 178 179 #line default 180 #line hidden 181 WriteLiteral("\t<div"); 182 183 WriteLiteral(" class=\"alert alert-dark m-0\""); 184 185 WriteLiteral(" role=\"alert\""); 186 187 WriteLiteral(">\r\n\t\t<span>"); 188 189 190 #line 77 "D:\dynamicweb.net\Solutions\nextech\Superhome.swiftstaging.dynamicweb-cms.com\files\Templates\Designs\Swift\Paragraph\DiscountExplanation.cshtml" 191 Write(Translate("No products available")); 192 193 194 #line default 195 #line hidden 196 WriteLiteral("</span>\r\n\t</div>\r\n"); 197 198 199 #line 79 "D:\dynamicweb.net\Solutions\nextech\Superhome.swiftstaging.dynamicweb-cms.com\files\Templates\Designs\Swift\Paragraph\DiscountExplanation.cshtml" 200 } 201 202 #line default 203 #line hidden 204 } 205 } 206 } 207
1 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.ParagraphViewModel> 2 @using Dynamicweb.Ecommerce.ProductCatalog 3 4 @{ 5 ProductViewModel product = null; 6 if (Dynamicweb.Context.Current.Items.Contains("ProductDetails")) 7 { 8 product = (ProductViewModel)Dynamicweb.Context.Current.Items["ProductDetails"]; 9 } 10 else if (Pageview.Page.Item["DummyProduct"] != null && Pageview.IsVisualEditorMode) 11 { 12 var pageViewModel = Dynamicweb.Frontend.ContentViewModelFactory.CreatePageInfoViewModel(Pageview.Page); 13 ProductListViewModel productList = pageViewModel.Item.GetValue("DummyProduct") != null ? pageViewModel.Item.GetValue("DummyProduct") as ProductListViewModel : new ProductListViewModel(); 14 15 if (productList?.Products is object) 16 { 17 product = productList.Products[0]; 18 } 19 } 20 21 22 23 //CS NT.. 24 25 string DiscountExplanation_Text = "";//"Buy 30 euros worth of products and get this for"; 26 string DiscountExplanation_percentage = "";//"€ 5.25"; 27 28 string DiscountExplanation = ""; 29 foreach (var p in product.ProductFields) 30 { 31 if (p.Key == "DiscountExplanation" && p.Value != null && !string.IsNullOrWhiteSpace(p.Value.ToString())) 32 { 33 DiscountExplanation = p.Value.ToString(); 34 DiscountExplanation = DiscountExplanation.Trim().Replace("±","€").Replace("�","€"); 35 // split based on $ character DiscountExplanation_Text 36 var DiscountExplanation_Unsplitted = DiscountExplanation.Split("$".ToCharArray()); 37 if (DiscountExplanation_Unsplitted.Length == 2) 38 { 39 if (!string.IsNullOrWhiteSpace(DiscountExplanation_Unsplitted[0])) 40 { 41 DiscountExplanation_Text = DiscountExplanation_Unsplitted[0]; 42 } 43 if (!string.IsNullOrWhiteSpace(DiscountExplanation_Unsplitted[1])) 44 { 45 DiscountExplanation_percentage = DiscountExplanation_Unsplitted[1]; 46 } 47 DiscountExplanation_Text = Pageview.Area.CultureInfo.TwoLetterISOLanguageName == "el" ? Translate(DiscountExplanation_Text.Replace("+"," ")) : DiscountExplanation_Text; 48 DiscountExplanation_Text += " <span class='discountExplanationPercentage_Span'>€" + DiscountExplanation_percentage + "</span>"; 49 } 50 else 51 { 52 DiscountExplanation_Text = DiscountExplanation; 53 } 54 break; 55 } 56 } 57 58 59 60 } 61 62 63 @if (product is object) 64 { 65 string fontsize_style = "font-size:" + Model.Item.GetRawValueString("Font_Size", "12px") + ";"; 66 67 <div class="DiscountExplanation_Container"> 68 @if(!string.IsNullOrWhiteSpace(DiscountExplanation_Text)) 69 { 70 <div style="width:100%" class="DiscountExplanation" style="@fontsize_style">@lang @DiscountExplanation_Text</div> 71 } 72 </div> 73 } 74 else if (Pageview.IsVisualEditorMode) 75 { 76 <div class="alert alert-dark m-0" role="alert"> 77 <span>@Translate("No products available")</span> 78 </div> 79 }
WOODEN HANGERS 3PCS PVC NATURAL
0201109
In stock