[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date
][Minivend by thread
]
Re: [mv] [setlocale] problem
On Tue, 9 Nov 1999 07:23:11 -0500, Jerry wrote:
>****** message to minivend-users from "Jerry" <jerry@data-logic.com> ******
>
>Hopefully someone can help with this.
>Using MV 3.14-3 I need to set the locale
>based on a scratch variable or userdb data field,
>to change the PriceField.
>
>Everything works great if I use:
>[setlocale locale="dsale" currency="dsale" persist=1]
>
>However, if I try to [setlocale] from a scratch variable
>userate set to dsale with:
>[setlocale locale="[scratch userate]" currency="[scratch userate]"
>persist=1]
>
>I get the following error in the catalog error.log
>[09/November/1999:07:09:12 -0500] easi /cgi-bin/easi attempt to set
>non-existant locale '
>> dsale
This error means that you haven't defined the locale.
I'm not sure about setting it from a scratch variable or the userdb, but
changing locales (both languages and currency) works for me this
way: set a new locale in catalog.cfg (as per the en_US model), and
add these to locale.asc (both tab separated): eg,
code en_GB nz_NZ eu_EU ru_RU
PriceDivide 1 .4 .6 (etc for each defined locale)
Then, where you want to change locale, you can invoke it like so:
[page process/locale/ru_RU/currency/en_GB/page/index]Russian - USD[/page]
You can also do this on, say, the index page (with random products), to
get both the chosen currency and a converted one (eg, Euros):
[loc]Our Price[/loc]:[loop-price] ( [setlocale currency=eu_EU][price [loop-code]] )
This all works well for languages and currencies. There is a small problem
though with the "quick basket" I have on each results page, as this shows
the prices in Euros instead of the chosen currency - hmm..
This may or may not do what you want. It's also quite possible that
if you remove the 'persist=1' then your changes may take effect.
>In despeation I even tried stuffing that value directly into mv_locale which
>of course
>didn't work. :)
>Perhaps someone else has tried something similiar?
>
>Regards,
>Jerry