an ASP.NET Open Source CMS & eCommerce platform
Search:
Last Post 12/18/2008 9:36:16 AM By Newmedia Design. 10 replies.
12/10/2008 12:39:23 PM
Newmedia Design
Posts: 65
Joined: 9/25/2008
Currency
Hi
 
 
How is the currency calculated for example euro versus dollar because on out test server the currency displays as euro and on the live/production server it's dollars.
 
Thanks 
 
 
12/10/2008 3:33:05 PM
lukezy
Posts: 2109
Joined: 6/12/2007
Location:WA, US
Re: Currency
The full multi-language support is comming in V3. Here is what you can do to change the thread current culture. Overwrite the method InitializeCulture in the code behind page class.
 
 protected override void InitializeCulture() {
            string culture = SiteConfigurationSection.GetSection().Culture;
            Thread.CurrentThread.CurrentUICulture = new CultureInfo(culture);
            Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture(culture);
        }
DotShoppingCart Staff
12/11/2008 7:38:56 AM
Newmedia Design
Posts: 65
Joined: 9/25/2008
Re: Currency
Thanks Lukezy
12/15/2008 3:59:06 AM
Newmedia Design
Posts: 65
Joined: 9/25/2008
Re: Currency
Hi Lukezy
 
I added this to the web.config   <globalization culture="en-IE"/> . This fixed all my currency and datetime issues but one.
The only area I am having currency issues now is in the emails for example the customer order email.
I am not sure what page I should add this to
 
 protected override void InitializeCulture() {
            string culture = SiteConfigurationSection.GetSection().Culture;
            Thread.CurrentThread.CurrentUICulture = new CultureInfo(culture);
            Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture(culture);
        }
 
 
 
 
 
 but i added it to the admin/order/orderedit.aspx.cs for the order completed emails but no joy.
 
Is there anyway I can modify the currency sign on the emails (  %Order.DetailHtml%) ?
 
Thanks
12/16/2008 12:19:57 AM
lukezy
Posts: 2109
Joined: 6/12/2007
Location:WA, US
Re: Currency
The order emails are sent in OrderPipleline. Are you running OrderPipeline as part of web app or a separate windows service?
DotShoppingCart Staff
12/16/2008 2:44:07 AM
Newmedia Design
Posts: 65
Joined: 9/25/2008
Re: Currency
Hi Lukezy
 
Running it as part of web app.
 
I have also added this to our web.config
 
<globalization requestEncoding="utf-8" responseEncoding="utf-8" culture="en-IE" uiCulture="en-IE"/>
 
This is a screen grab of our IIS settings. But the emails still display dollar signs. is there anywhere I need to change settings?  <img src="http://development-ie.access.secure-ssl-servers.biz/2.jpg" alt="" />
12/17/2008 6:55:30 AM
Newmedia Design
Posts: 65
Joined: 9/25/2008
Re: Currency
Hi Lukezy
 
Just to update you. We have checked all our settings.
 
Web.config
<globalization requestEncoding="utf-8" responseEncoding="utf-8" culture="en-IE" uiCulture="en-IE"/>
 
IIs
all settings set to en-IE.
 
I have created a basic script and emailed the result from a test webpage and they all display the euro symbol but when i get order confimation/completion emails they are in dollars. Is there anything else I can do to force euro symbols on  these emails? Anything at all that might help as I am getting desperate. We cant put this live until the proper currency symbol is displayed in emails.
 
 string str = String.Empty;
        using (SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["dsc"].ConnectionString))
        {
           
            string sql = "select amount from DSC_order_total";
            conn.Open();
            SqlCommand cmd = new SqlCommand(sql, conn);
            SqlDataReader sdr = cmd.ExecuteReader();
            if (sdr.HasRows)
            {
                while (sdr.Read())
                {
                    string s = String.Empty;
                    total = Decimal.Parse(sdr[0].ToString());
                    str += total.ToString("C") + "<br />";
                }
            }
            conn.Close();
        }
        return str;
 
 
12/17/2008 3:38:25 PM
lukezy
Posts: 2109
Joined: 6/12/2007
Location:WA, US
Re: Currency
OrderPipeline spawns a new thread for sending order confirmation emails. It seems that the new thread doesn't use the culture setting in the web.config. Maybe it's using the operating system default culture setting. Is it possible to change the operating system culture setting?
DotShoppingCart Staff
12/18/2008 2:01:01 AM
Newmedia Design
Posts: 65
Joined: 9/25/2008
Re: Currency
Hi Lukezy
 
The culture setting for the OS is 
 
windows 2003
All Regional and Language settings are all set to English(Irish) which is correct.
 
Is there anywhere else or any other setting I can check that I might be missing?
 
Its the clients dedicated server so we dont have the option to move host unfortunately.
 
The project will have to be scrapped as we can't send our emails with dollar signs.
 
So if you can think of anything, anything at all would be great.
 
You  mentioned putting this code in the code behind page
 
protected override void InitializeCulture() {
            string culture = SiteConfigurationSection.GetSection().Culture;
            Thread.CurrentThread.CurrentUICulture = new CultureInfo(culture);
            Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture(culture);
        }
 
what pages would i add this to for when order confirmation and order complete emais are sent? 
 
 
 
Thanks Lukezy
 
12/18/2008 4:58:57 AM
lukezy
Posts: 2109
Joined: 6/12/2007
Location:WA, US
Re: Currency
The code could be put in the master page code behind class. But it won't solve your issue because it's the new thread in the orderpipeline that sends the emails. I have a tempoary fix for you. Try using this DotShoppingCart.Commercial.OrderPipeline.dll to see if it fixes your issue.
DotShoppingCart Staff
12/18/2008 9:36:16 AM
Newmedia Design
Posts: 65
Joined: 9/25/2008
Re: Currency
Thanks Lukezy
 
That worked