We've created the custom field "PriceRange" and added to Web\Store\ProductSummary\Price.ascx.cs. Snipet of code below:
Our thinking is that if there is no data in the PriceRange field, then continue processing the pricing procedure normally. If there is data in the PriceRange field, then display that instead of the normal pricing
-*-*-*-*-*-*-*
public override void DataBind() {
base.DataBind();
if (null != Product.PriceRange) {
lblCurrentPrice.Text = Product.PriceRange.ToString("c");
} else { if (0 == Product.Price)
lblCurrentPrice.Visible = lblCrossPrice.Visible = false;
-*-*-*-*-*-*-*
But gives the following error when the page loads
<span>
Server Error in '/shop' Application.<hr color="#c0c0c0" size="1" width="100%" />
Compilation Error
</span> Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: CS1061: 'DotShoppingCart.Commercial.Core.Product' does not contain a definition for 'PriceRange' and no extension method 'PriceRange' accepting a first argument of type 'DotShoppingCart.Commercial.Core.Product' could be found (are you missing a using directive or an assembly reference?)
Source Error:
<table width="100%" bgcolor="#ffffcc"> <tbody> <tr> <td> </td> </tr> <tr> <td>
Line 26: public override void DataBind() {
Line 27: base.DataBind();
Line 28: if (null != Product.PriceRange) {
Line 29: lblCurrentPrice.Text = Product.PriceRange.ToString("c");
Line 30: } else { if (0 == Product.Price)
</td> </tr> </tbody> </table>
Source File: e:\docs\www.rettigmusic.com\DotShoppingCartSuiteV4.0.3\Web\Store\ProductSummary\Price.ascx.cs Line: 28
<div class="expandable" onclick="OnToggleTOCLevel1('compilerOutputDiv')"> Show Detailed Compiler Output:
<div id="compilerOutputDiv" style="display: none">
<table width="100%" bgcolor="#ffffcc"> <tbody> <tr> <td>
Microsoft (R) Visual C# 2008 Compiler version 3.5.30729.1
for Microsoft (R) .NET Framework version 3.5
Copyright (C) Microsoft Corporation. All rights reserved.
e:\docs\www.rettigmusic.com\DotShoppingCartSuiteV4.0.3\Web\Store\ProductSummary\Price.ascx.cs(28,29): error CS1061: '
DotShoppingCart.Commercial.Core.Product' does not contain a definition for 'PriceRange' and no extension method 'PriceRange'
accepting a first argument of type 'DotShoppingCart.Commercial.Core.Product' could be found (are you missing a using directive or
an assembly reference?)
e:\docs\www.rettigmusic.com\DotShoppingCartSuiteV4.0.3\Web\Store\ProductSummary\Price.ascx.cs(29,44): error CS1061:
'DotShoppingCart.Commercial.Core.Product' does not contain a definition for 'PriceRange' and no extension method 'PriceRange'
accepting a first argument of type 'DotShoppingCart.Commercial.Core.Product' could be found (are you missing a using directive
or an assembly reference?)
</td> </tr> </tbody> </table>
<div class="expandable" onclick="OnToggleTOCLevel1('dynamicCodeDiv')">Show Complete Compilation Source:
<div id="dynamicCodeDiv" style="display: none">
<table width="100%" bgcolor="#ffffcc"> <tbody> <tr> <td>
Line 1: #pragma checksum "E:\docs\www.rettigmusic.com\DotShoppingCartSuiteV4.0.3\Web\Store\ProductSummary\Price.ascx" "{406ea660-64cf-4c82-b6f0-42d48172a799}" "C8AFEE0E6A5EC7966A70330978FFCC53"
</td> </tr> </tbody> </table>
<script type="text/javascript"> function OnToggleTOCLevel1(level2ID) { var elemLevel2 = document.getElementById(level2ID); if (elemLevel2.style.display == 'none') { elemLevel2.style.display = ''; } else { elemLevel2.style.display = 'none'; } } </script>
<hr color="#c0c0c0" size="1" width="100%" />
Version Information: Microsoft .NET Framework Version:2.0.50727.3615; ASP.NET Version:2.0.50727.3618
What else am I missing?
|