[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date
][Minivend by thread
]
setlocale - passing in and pulling out data
Hallo all
I have 2 problems, related to a similar point of principle,
and after several days all I've achieved is brain cramp :(
The first one: someone chooses a country from a drop-down
list. After updating, I want to pull this out into a pre-filled field
in an address form. Doing this with [value country] fills in
the abbreviated name, eg UK for United Kingdom. In the
country.asc the full name is in field 4, and I've tried every
variation I can think of to display the full name, but no dice.
I know this will be embarassingly simple ....
The second one: I'm setting up a catalogue whereby the
user chooses a language and currency on the home page
before hitting the MV pages (but can still choose on those
pages also). The problem is that I want to display 3
currencies for each language choice. First currency is
the seller's currency (in which the buyer pays), the second
is the buyer's own chosen currency (to avoid the need for
mental calculations) and the third is Euros (for cross-border
transparency). The Euros will be eliminated on the
basket and checkout pages, leaving only the first two.
Using [setlocale .. ] works well *if* you are changing the
main currency tag ([item price] etc) to the user's curency.
This is what setlocale is designed for and it's fine. The
problem comes when the main currency should remain
static and the others should change. It works well
enough on index or results pages, but starts to fall apart
on the basket and then by the checkout/receipt/email
stage it is a total disaster - MV becomes totally confused
and is liable to charge 10 French Francs instead of 10
British Pounds Sterling. You can see the sad results at
http://www.topshopping.net/bltest/, along with visible tags.
A much more solid approach is to use Usertags - there's
one posted by Robert Schaller on 21.09.99 which is perfect
for this - usage is, eg, [nzd][item-price noformat=1][/nzd].
Every language is then configured with the same currency
in catalog.cfg so that the "main price" will be constant.
Because there is no [setlocale ..] tag anywhere on the
pages (and the language is set by the session locale)
the main price is not affected at all.
This works all the way through to the receipt and email
stage without problem, if the [nzd] or [whatever] is stated
explicitly on each page. Problem: to pass the [whatever]
through the URL link and then pull it out into each page. Eg,
<A HREF="/cgi-bin/bl/process/locale/ru_RU/page/index?;nzd;">
is my reading of the technique, but as it doesn't work I've
plainly RTFM wrongly. It passes the language (Russian)
correctly, and the error logs contain nothing. I think (??)
that [data session nzd] should pull it out again, but even
that is not ideal. I've RTFM to the point where I need new
glasses, and can't quite see the solution.
What I'm really looking for seems to be this:
<a href=......./usertagname/param>, where 'param' is an attribute
for a usertag which formats any currency according
to the attribute (pretty much the same style as the present
/currency/nz_NZ/, except that this works on existing tags
which will not succedd in this situation).Then to pull this
currency out and display it,
[usertagname::data][item-price][/usertagname], where
'data' pulls the param. Now that I write this, I'm feelling
even more confused and brain cramped ! Look at
http://www.topshopping.net/bl/ for the required result,
but using [frf][<price or whatever> noformat=1][/frf] tags
on each operation - these are visible as well.
Can anyone - please - give me a clue on this? Many TIA.
(Sorry for the long post !)
Cheers
Lyn