Page 1 of 1

Error calculating price on product page.

Posted: Thu Dec 11, 2008 10:20 am
by digitalkemical
I'm getting this error :

[[ConLib:Custom/FramedMirrorProductDialog]] d:\hosting\iartzstore\ConLib\Custom\FramedMirrorProductDialog.ascx.cs(525): error CS1002: ; expected


From this code it seems:

Code: Select all

 {
        //GET THE CURRENT CALCULATED PRICE
        string optionList = ProductVariantDataSource.GetOptionList(_ProductId, _SelectedOptions, true);
        ProductCalculator pcalc = ProductCalculator.LoadForProduct(_ProductId, 1, optionList, _SelectedKitProducts);
        LSDecimal otherCost = pcalc.Price - _Product.Price;
        LnFtCost = ((((((Width + Height) * 2 / 12) * _Product.Price) + (((((Width + Height) / 144)-(Width * 2)) * Bevel) + 3.5)) * .25) * 2) * 2) ;
        CalculatedCost = LnFtCost + otherCost;
        PricePerLnFtLabel.Text = _Product.Price.ToString("ulc");
        CalculatedPriceLabel.Text = CalculatedCost.ToString("ulc");
    }
Any thoughts? Thanks.

Re: Error calculating price on product page.

Posted: Fri Dec 12, 2008 5:35 am
by mazhar
The problem seems to be in the follwong line

Code: Select all

LnFtCost = ((((((Width + Height) * 2 / 12) * _Product.Price) + (((((Width + Height) / 144)-(Width * 2)) * Bevel) + 3.5)) * .25) * 2) * 2) ;
Try by making it look like as below

Code: Select all

LnFtCost = (((((((Width + Height) * 2 / 12) * _Product.Price) + (((((Width + Height) / 144)-(Width * 2)) * Bevel) + 3.5)) * .25) * 2) * 2) ;

Re: Error calculating price on product page.

Posted: Fri Dec 12, 2008 7:04 am
by digitalkemical
Got it Working!

Code: Select all

LnFtCost = ((((((((((Width - _Product.MSRP) * (Height - _Product.MSRP))/144) * Bevel) + 3.5M + ((((Width + Height) * 2) / 12) * _Product.Price))) * 1.25M)) * 2)) *2;