[ic] Country variable lost when logging out

Interchange user interchange-users@icdevgroup.org
Tue Nov 5 13:23:01 2002


> > > > If I log in and log out again, and then go to the checkout page, my
> > > > shipping routine is not returning anything. I have found that this is
> > > > because the [value country] variable that is normally passed to it is
> > > > lost upon logging out. It will stay this way until I hit
> > > > 'recalculate', change the country, or log back in, even if I go to
> > > > another page and then come back to the checkout page.
> > >
> > >
> > > You could modify your catalog.cfg to include this directive:
> > >
> > >     ValuesDefault  country  GB
> > >
> > > Where 'GB' is the default to be set (change to whatever you need).
> > > The [value country] will be initialised with the default whenever a
> > > new session is allocated.
> >
> >
> > But that doesn't solve the little problem he is describing, which is
> > logging out (which clears the country value) within the same session,
> > then returning to the checkout page. In that case, just add something
> > like this to the top of ord/checkout.html:
> >
> > [value name=country set="[either][value country][or]US[/either]" hide=1]
> >
> > ... you could also use the default country variable from the variable
> > table as the settor instead of 'US'
>
>
> I knew I must have misunderstood the question. It was all the logging
> out and in that got me confused.
>
> Logging out shouldn't clear the country value (or others) unless the
> following is used:
>
>     [userdb function=logout clear=1]
>
> If you're doing that, and you don't want the values to clear, then
> simply remove the "clear=1".  ValuesDefault will take care of the
> initial default.  Perhaps "userdb clear" should restore the appropriate
> defaults automagically, instead of simply deleting the values.

Kevin,

Yeah, 'ValuesDefault  country  __SHIP_DEFAULT_COUNTRY__' is already in 
catalog.cfg, and the variable is correctly defined in variable.txt - doesn't 
make any difference.

I will go the route of explicitly setting the country at the top of 
checkout.html, that way I should be able to guarantee that a country is 
always selected on that page.

Thanks.