Created
January 31, 2014 17:03
-
-
Save netsi1964/8736344 to your computer and use it in GitHub Desktop.
Razor snippet which will show a formated Cart TotalPrice
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@{ | |
// Check if cart exists | |
var cart = "Empty"; | |
if (System.Web.HttpContext.Current.Session["eComCart"]!="") | |
{ | |
Dynamicweb.eCommerce.Orders.Order order = (Dynamicweb.eCommerce.Orders.Order) System.Web.HttpContext.Current.Session["eComCart"]; | |
// Format like this: 1.299,95 | |
cart = String.Format("{0:0,0.00}", order.TotalPrice); | |
} | |
} | |
<h1>@cart</h1> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This snippet can be pasted in any Razor based Dynamicweb Template. You may wish to use other formatting or output. A useful site for formatting in
C#
is string format double .