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 13 of 13

Thread: Specify currency and/or locale in a query string?

  1. #1
    sspmurphy is offline Member
    Join Date
    Feb 2007
    Posts
    86

    Default Specify currency and/or locale in a query string?

    Hey guys,

    I'm wondering if it is possible to specify currency and/or locale in a query string.

    So, if I provide a link to someone in Australia or for Australian PPC ads can I append a query string to the URL to show them a localized page?

    Thanks!

    Philip

  2. #2
    ASPDNSF Staff - Jon's Avatar
    ASPDNSF Staff - Jon is offline Senior Member
    Join Date
    Sep 2004
    Posts
    11,419

    Default

    Here's an example:

    www.mysite.com/ p-1-blue-widget.aspx?currencysetting=AUD&localesetting=en-AU
    Jon Wolthuis

  3. #3
    sspmurphy is offline Member
    Join Date
    Feb 2007
    Posts
    86

    Default

    Nice! Thank you!

    Is it possible to do this with a skin using the same logic? (i.e. skinid=Skin_2)

    Sorry, should have asked that in the first question.

    UPDATE: www.mysite.com/default.aspx?skinid=2

    Thanks
    Last edited by sspmurphy; 03-05-2009 at 05:32 PM.

  4. #4
    ASPAlfred is offline Senior Member
    Join Date
    Nov 2007
    Posts
    2,244

    Default

    Yep. Try this:

    yoursite.com/ c-19-gift-cards.aspx?skinid=2&currencysetting=AUD&localesett ing=en-AU

  5. #5
    weblingo is offline Member
    Join Date
    Feb 2008
    Location
    Bristol, UK
    Posts
    63

    Default

    Should the localesetting change work immediately when set in the querystring? i.e. on first load of that page

    I'm convinced this was working as I expected, but now the locale change is lagging one page behind:

    page.aspx - displays in English (default) correct
    page.aspx?localesetting=es-ES - displays in English. Wrong should be Spanish
    page.aspx - displays in Spanish. OK
    page.aspx?localesetting=en-GB - displays in Spanish. Wrong should be English
    page.aspx - displays in English - OK

    Thanks in advance

  6. #6
    ASPDNSF Staff - Eileen is offline Banned
    Join Date
    May 2008
    Posts
    43

    Default

    Yes, it should. Are you using Safari browser?

  7. #7
    weblingo is offline Member
    Join Date
    Feb 2008
    Location
    Bristol, UK
    Posts
    63

    Default

    The problem was first noticed in Safari, but yesterday it was happening in IE7

    Today IE7 is fine. Just tested and it's not working as expected in Safari, Firefox and Chrome

    Is this a known error? Any info on what's causing it and how to fix would be great

    Thanks

  8. #8
    DanV's Avatar
    DanV is offline Ursus arctos horribilis
    Join Date
    Apr 2006
    Posts
    1,568

    Default

    The best way to do this via querystring is to use the setcurrency or setlocale.aspx pages. which will set the user's locale and then redirect them to whatever page is specified in the "ReturnURL" querystring parameter. Otherwise, by the time the locale is set, the page has already been mostly generated, meaning that the new locale setting will not impact the current page view, but will impact subsequent pages.

  9. #9
    weblingo is offline Member
    Join Date
    Feb 2008
    Location
    Bristol, UK
    Posts
    63

    Default

    Thanks Dan - the problem with using setcurrency or setlocale is that the user sees (if only for a second) the intermediate page, which would not look good when navigating around

    Is it possible to move the change of localesetting/currencysetting earlier in the process? Maybe high up in Skinbase.cs? We have full source code

    And I don't understand why it works sometimes and not others (on the same pages) or why it's different for different browsers

    Thanks

  10. #10
    DanV's Avatar
    DanV is offline Ursus arctos horribilis
    Join Date
    Apr 2006
    Posts
    1,568

    Default

    You can mod skinbase to do this, yes. Is it necessary to dynamically change the locale as the user clicks around the site though? Setting the locale either based on user input, or automatically by detecting their locale when they hit the site is usually sufficient in most cases, and is a lot less complex.

  11. #11
    weblingo is offline Member
    Join Date
    Feb 2008
    Location
    Bristol, UK
    Posts
    63

    Default

    Dan - thanks for your help thus far

    I have moved the check for the querystring to OnPreInit of Skinbase.cs (immediately after m_ThisCustomer = ((AspDotNetStorefrontPrincipal)Context.User).ThisC ustomer), but it's still not working

    String LocaleSetting = CommonLogic.QueryStringCanBeDangerousContent("Loca leSetting");
    AppLogic.CheckForScriptTag(LocaleSetting);
    LocaleSetting = Localization.CheckLocaleSettingForProperCase(Local eSetting);
    ThisCustomer.LocaleSetting = LocaleSetting;


    I can debug this and see it picking up the locale from the querystring, but after the last line ThisCustomer.LocaleSetting is still set to the old locale. Run it again and it gets set OK

    Unless I'm doing something really silly, I don't see
    a) why this won't set on 1st go
    b) why behaviour is inconsistent
    c) why behaviour differs between browsers

    We didn't see this issue during testing, so now we have gone live customers are complaining. Any help very much appreciated

    Thanks

  12. #12
    omaxuk is offline Member
    Join Date
    Apr 2009
    Location
    We're Brits
    Posts
    73

    Default I'm having exactly the same problem with locales not flippping

    We're seeing exacly the same problem. Like Web Lingo we are UK based. Didn't notice this in testing, our devs initialy had this as a Mac Browser issue, but now we're 'live' we see it in XP on IE as well. Windows Firefox too. But appears random. Which is not helpful and confusing because I've been reporting differnt issues, which now appear as part of the same issue and our devs thought we were tinkering with their work.

    Yet I know it can work: See a site, (not ours) going great.

    http://www.e-tradecounter.co.uk/

    This site flips currency to currency fine, but does it via the 'spalsh' page. See it flips from:

    http://www.e-tradecounter.co.uk/Default.aspx

    to:

    http://www.e-tradecounter.co.uk/setc...ncysetting=GBP

    And then to:

    http://www.e-tradecounter.co.uk/Default.aspx

    And if you seelct euro, back to Euros via

    http://www.e-tradecounter.co.uk/setc...ncysetting=EUR

    Back to:

    http://www.e-tradecounter.co.uk/Default.aspx

    Where as, on our site the lag is still one locale behind the one clicked. I'll post here, to let you know what our devs find. But can't get them right now, seem to have gone a bit thin on the ground this week.
    Last edited by omaxuk; 08-11-2009 at 03:39 AM. Reason: Typo and errors

  13. #13
    tito is offline Senior Member
    Join Date
    Sep 2005
    Posts
    213

    Default

    Has anybody solved this problem. I would like to change local via a link URL and remain but return the same page and not the default.aspx page.

    Cheers guys ..
    Version 9.2
    Gordon

    8.1.1