Developer forum

Forum » Ecommerce - Standard features » Discount total amount not formatted

Discount total amount not formatted

Kasper Skov
Reply

Not sure if it's a bug or i'm doing something wrong

@i.GetValue("Ecom:Product.Discount.TotalAmountWithoutVATFormatted")

Does not format the string. Price and Discount.Price are formatted fine.

discount.png

Replies

 
Kristian Kirkholt
Reply

Hi Kasper

 

The ("Ecom:Product.Discount.TotalAmountWithoutVATFormatted")

< ! -- @ Ecom:Product.Discount.TotalAmountWithVATFormatted -- >

 

I do not get any output either.. Could ÿou please create a support case about this.

 

Kind Regards

Kristian Kirkholt

 
Morten Bengtson
Reply

Well, you can do anything in Razor :) 

Try this instead...

 

@functions{
    Dynamicweb.eCommerce.International.Currency currency = Dynamicweb.eCommerce.Common.Context.Currency;
    
    string FormatPrice(double price)
    {
        return currency.Format(price, true);
    }
}

<ul>
@foreach (var i in GetLoop("Products"))
{
    <li>Total Discount: @FormatPrice(i.GetDouble("Ecom:Product.Discount.TotalAmountWithoutVAT"))</li>
}
</ul>

 

You must be logged in to post in the forum