Important Notice from AspDotNetStorefront
It is with dismay that we report that we have been forced, through the action of hackers, to shut off write-access to this forum. We are keen to leave the wealth of material available to you for research. We have opened a new forum from which our community of users can seek help, support and advice from us and from each other. To post a new question to our community, please visit: http://forums.vortx.com
Results 1 to 3 of 3

Thread: Template file per currency

  1. #1
    nihon is offline Senior Member
    Join Date
    May 2008
    Posts
    150

    Default Template file per currency

    Hi i would like to have a template file for each Currency..
    I know we can have a template file for each local, by adding the local name to the end of the template file name, example template.en-GB.ascx

    But can this be done for just the currency with our adding the local to the system.
    Does any body know if this can be done, currency rather to the local.
    I would not like to add an other local just a currency.

    maybe something like this .. template.AUD.ascx (by the way this does not work)

    Thank you
    Version (Code/DB):
    AspDotNetStorefront ML 8.1.2.0/8.1.2.0

  2. #2
    MarkC is offline Developer
    Join Date
    Aug 2006
    Posts
    166

    Default

    You can easily achieve this by modifying {web}/App_Code/SkinBase.cs :

    look for the function LoadSkinTemplate and change this:
    C#/VB.NET Code:
    if (_url == null)
                    {
                        
    // try customer locale:
                        
    _url Path.Combine(SkinRootm_TemplateName.Replace(".ascx""." ThisCustomer.LocaleSetting ".ascx"));

                        
    m_TemplateFN CommonLogic.SafeMapPath(_url);
                        if (!
    CommonLogic.FileExists(m_TemplateFN))
                        {
                            
    // try default store locale path:
                            
    _url Path.Combine(SkinRootm_TemplateName.Replace(".ascx""." Localization.GetWebConfigLocale() + ".ascx"));
                            
    m_TemplateFN CommonLogic.SafeMapPath(_url);
                        }

                        ... 
    snip ..... 
    to:

    C#/VB.NET Code:
    if (_url == null)
                    {
                        
    // try customer's currency code specific template
                        
    _url Path.Combine(SkinRootm_TemplateName.Replace(".ascx""." ThisCustomer.CurrencySetting ".ascx"));
                        
    m_TemplateFN CommonLogic.SafeMapPath(_url);

                        if (!
    CommonLogic.FileExists(m_TemplateFN))
                        {
                            
    // try customer locale:
                            
    _url Path.Combine(SkinRootm_TemplateName.Replace(".ascx""." ThisCustomer.LocaleSetting ".ascx"));
                            
    m_TemplateFN CommonLogic.SafeMapPath(_url);
                        }                    
                        
                        if (!
    CommonLogic.FileExists(m_TemplateFN))
                        {
                            
    // try default store locale path:
                            
    _url Path.Combine(SkinRootm_TemplateName.Replace(".ascx""." Localization.GetWebConfigLocale() + ".ascx"));
                            
    m_TemplateFN CommonLogic.SafeMapPath(_url);
                        }


                        ... 
    snip ..... 

    This will try to look for currency specific template first, if there's one defined, otherwise fallback to the default template resolution.

  3. #3
    nihon is offline Senior Member
    Join Date
    May 2008
    Posts
    150

    Default

    Brilliant ...thank you so much ... you guys seriously kick ass..

    Thanks AGAIN..
    Version (Code/DB):
    AspDotNetStorefront ML 8.1.2.0/8.1.2.0