You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by rohit2006 <ro...@yahoo.com> on 2009/06/01 08:08:12 UTC

How to set-up Multicurrency in ofbiz

Hi,

I have a requirement to show product prices in difference currency. From
what i understand, ofbiz supports multicurrency, but i have been unable to
set it up.

I tried the following actions on the demo ofbiz server. I added the price in
GBP for the product ID WG-5569. I did not set the default currency for the
store to GBP, but instead tried to set default currency for the session
using the the URI
http://demo.ofbiz.org/ecommerce/products/PROMOTIONS/p_WG-5569?setSessionCurrencyUom?currencyUom=GBP

Still the prices are shown in USD, i will appreciate if someone can help me
with this.

What i am trying to achieve is, that the default currency should be USD,
however when user from UK access the products, with URL's amended with
currency information, the product page should show the prices in GBP instead
of USD.

Thanks for the help.

Rohit
   
-- 
View this message in context: http://www.nabble.com/How-to-set-up-Multicurrency-in-ofbiz-tp23810343p23810343.html
Sent from the OFBiz - User mailing list archive at Nabble.com.


Re: How to set-up Multicurrency in ofbiz

Posted by Jacopo Cappellato <ja...@hotwaxmedia.com>.
It works for me, even if the currency symbol, and the selected  
currency in the drop down, don't change.

Jacopo

On Jun 4, 2009, at 8:04 AM, Ashish Vijaywargiya wrote:

> I am observing the same behavior.
>
> --
> Ashish
>
> On Wed, Jun 3, 2009 at 9:39 PM, rohit2006 <ro...@yahoo.com>  
> wrote:
>
>>
>> Hi Abhishake,
>>
>> Can you please recheck the website, i tried setting the currenct to  
>> USD and
>> Euro, but none worked. Only GBP is showing.
>>
>> Rohit
>>


Re: How to set-up Multicurrency in ofbiz

Posted by Ashish Vijaywargiya <vi...@gmail.com>.
I am observing the same behavior.

--
Ashish

On Wed, Jun 3, 2009 at 9:39 PM, rohit2006 <ro...@yahoo.com> wrote:

>
> Hi Abhishake,
>
> Can you please recheck the website, i tried setting the currenct to USD and
> Euro, but none worked. Only GBP is showing.
>
> Rohit
>

Re: How to set-up Multicurrency in ofbiz

Posted by rohit2006 <ro...@yahoo.com>.
Hi Abhishake,

Can you please recheck the website, i tried setting the currenct to USD and
Euro, but none worked. Only GBP is showing.

Rohit

Abhishake Agarwal wrote:
> 
> Hello Rohit,
> 
> I have implemented the code in below link and its working fine
> 
> http://www.goldencharm.co.uk/main
> 
> Regards,
> Abhishake
> 
> On Wed, Jun 3, 2009 at 2:05 PM, Jacopo Cappellato <
> jacopo.cappellato@hotwaxmedia.com> wrote:
> 
>> I would suggest to create two ProductStores (for the two currencies)
>> associated to two ecommerce sites.
>>
>> Jacopo
>>
>>
>> On Jun 1, 2009, at 8:08 AM, rohit2006 wrote:
>>
>>
>>> Hi,
>>>
>>> I have a requirement to show product prices in difference currency. From
>>> what i understand, ofbiz supports multicurrency, but i have been unable
>>> to
>>> set it up.
>>>
>>> I tried the following actions on the demo ofbiz server. I added the
>>> price
>>> in
>>> GBP for the product ID WG-5569. I did not set the default currency for
>>> the
>>> store to GBP, but instead tried to set default currency for the session
>>> using the the URI
>>>
>>> http://demo.ofbiz.org/ecommerce/products/PROMOTIONS/p_WG-5569?setSessionCurrencyUom
>>> ?currencyUom=GBP
>>>
>>> Still the prices are shown in USD, i will appreciate if someone can help
>>> me
>>> with this.
>>>
>>> What i am trying to achieve is, that the default currency should be USD,
>>> however when user from UK access the products, with URL's amended with
>>> currency information, the product page should show the prices in GBP
>>> instead
>>> of USD.
>>>
>>> Thanks for the help.
>>>
>>> Rohit
>>>
>>> --
>>> View this message in context:
>>> http://www.nabble.com/How-to-set-up-Multicurrency-in-ofbiz-tp23810343p23810343.html
>>> Sent from the OFBiz - User mailing list archive at Nabble.com.
>>>
>>>
>>
> 
> 

-- 
View this message in context: http://www.nabble.com/How-to-set-up-Multicurrency-in-ofbiz-tp23810343p23854464.html
Sent from the OFBiz - User mailing list archive at Nabble.com.


Re: How to set-up Multicurrency in ofbiz

Posted by Abhishake Agarwal <ab...@gmail.com>.
Hello Rohit,

I have implemented the code in below link and its working fine

http://www.goldencharm.co.uk/main

Regards,
Abhishake

On Wed, Jun 3, 2009 at 2:05 PM, Jacopo Cappellato <
jacopo.cappellato@hotwaxmedia.com> wrote:

> I would suggest to create two ProductStores (for the two currencies)
> associated to two ecommerce sites.
>
> Jacopo
>
>
> On Jun 1, 2009, at 8:08 AM, rohit2006 wrote:
>
>
>> Hi,
>>
>> I have a requirement to show product prices in difference currency. From
>> what i understand, ofbiz supports multicurrency, but i have been unable to
>> set it up.
>>
>> I tried the following actions on the demo ofbiz server. I added the price
>> in
>> GBP for the product ID WG-5569. I did not set the default currency for the
>> store to GBP, but instead tried to set default currency for the session
>> using the the URI
>>
>> http://demo.ofbiz.org/ecommerce/products/PROMOTIONS/p_WG-5569?setSessionCurrencyUom
>> ?currencyUom=GBP
>>
>> Still the prices are shown in USD, i will appreciate if someone can help
>> me
>> with this.
>>
>> What i am trying to achieve is, that the default currency should be USD,
>> however when user from UK access the products, with URL's amended with
>> currency information, the product page should show the prices in GBP
>> instead
>> of USD.
>>
>> Thanks for the help.
>>
>> Rohit
>>
>> --
>> View this message in context:
>> http://www.nabble.com/How-to-set-up-Multicurrency-in-ofbiz-tp23810343p23810343.html
>> Sent from the OFBiz - User mailing list archive at Nabble.com.
>>
>>
>

Re: How to set-up Multicurrency in ofbiz

Posted by Jacopo Cappellato <ja...@hotwaxmedia.com>.
I would suggest to create two ProductStores (for the two currencies)  
associated to two ecommerce sites.

Jacopo

On Jun 1, 2009, at 8:08 AM, rohit2006 wrote:

>
> Hi,
>
> I have a requirement to show product prices in difference currency.  
> From
> what i understand, ofbiz supports multicurrency, but i have been  
> unable to
> set it up.
>
> I tried the following actions on the demo ofbiz server. I added the  
> price in
> GBP for the product ID WG-5569. I did not set the default currency  
> for the
> store to GBP, but instead tried to set default currency for the  
> session
> using the the URI
> http://demo.ofbiz.org/ecommerce/products/PROMOTIONS/p_WG-5569?setSessionCurrencyUom 
> ?currencyUom=GBP
>
> Still the prices are shown in USD, i will appreciate if someone can  
> help me
> with this.
>
> What i am trying to achieve is, that the default currency should be  
> USD,
> however when user from UK access the products, with URL's amended with
> currency information, the product page should show the prices in GBP  
> instead
> of USD.
>
> Thanks for the help.
>
> Rohit
>
> -- 
> View this message in context: http://www.nabble.com/How-to-set-up-Multicurrency-in-ofbiz-tp23810343p23810343.html
> Sent from the OFBiz - User mailing list archive at Nabble.com.
>


Re: How to set-up Multicurrency in ofbiz

Posted by rohit2006 <ro...@yahoo.com>.
Hi Abhishake,

Did you check the code for setSessionLocale. I guess, that the information
for language and currency is stored in the locale session. If you also check
the code for create a new webshopping cart, pasted below, it gets the
currency from the locale. So i think the code should work as it is, but it
does not.

On the demo server too, when the locale is change to say, English (Great
Britain), the configurable products shows the prices in GBP and not any
other products. Also when a configurable product, quoted in GBP, is added to
the shopping card, the currency is change to USD.

I thus think multi-currency feature is already build in, but the code for
shoppingcart and product prices have some error.

I did not try your code, but will soon try and let you know if it works for
me.

Rohit

    /** Gets or creates the shopping cart object */
    public static ShoppingCart getCartObject(HttpServletRequest request,
Locale locale, String currencyUom) {
        LocalDispatcher dispatcher = (LocalDispatcher)
request.getAttribute("dispatcher");
        ShoppingCart cart = (ShoppingCart)
request.getAttribute("shoppingCart");
        HttpSession session = request.getSession(true);
        if (cart == null) {
            cart = (ShoppingCart) session.getAttribute("shoppingCart");
        } else {
            session.setAttribute("shoppingCart", cart);
        }

        if (cart == null) {
            cart = new WebShoppingCart(request, locale, currencyUom);
            session.setAttribute("shoppingCart", cart);
        } else {
            if (locale != null && !locale.equals(cart.getLocale())) {
                cart.setLocale(locale);
            }
            if (currencyUom != null &&
!currencyUom.equals(cart.getCurrency())) {
                try {
                    cart.setCurrency(dispatcher, currencyUom);
                } catch (CartItemModifyException e) {
                    Debug.logError(e, "Unable to modify currency in cart",
module);
                }
            }
        }
        return cart;
    }



Abhishake Agarwal wrote:
> 
> Hi,
> 
> please look at the link below
> 
> http://mail-archives.apache.org/mod_mbox/ofbiz-dev/200810.mbox/%3Ccaaebcd20810122206n2c0261d0t2dbb46ced85c61b5@mail.gmail.com%3E
> 
> Regards,
> Abhishake
> 
> On Mon, Jun 1, 2009 at 11:38 AM, rohit2006 <ro...@yahoo.com> wrote:
> 
>>
>> Hi,
>>
>> I have a requirement to show product prices in difference currency. From
>> what i understand, ofbiz supports multicurrency, but i have been unable
>> to
>> set it up.
>>
>> I tried the following actions on the demo ofbiz server. I added the price
>> in
>> GBP for the product ID WG-5569. I did not set the default currency for
>> the
>> store to GBP, but instead tried to set default currency for the session
>> using the the URI
>>
>> http://demo.ofbiz.org/ecommerce/products/PROMOTIONS/p_WG-5569?setSessionCurrencyUom?currencyUom=GBP
>>
>> Still the prices are shown in USD, i will appreciate if someone can help
>> me
>> with this.
>>
>> What i am trying to achieve is, that the default currency should be USD,
>> however when user from UK access the products, with URL's amended with
>> currency information, the product page should show the prices in GBP
>> instead
>> of USD.
>>
>> Thanks for the help.
>>
>> Rohit
>>
>> --
>> View this message in context:
>> http://www.nabble.com/How-to-set-up-Multicurrency-in-ofbiz-tp23810343p23810343.html
>> Sent from the OFBiz - User mailing list archive at Nabble.com.
>>
>>
> 
> 

-- 
View this message in context: http://www.nabble.com/How-to-set-up-Multicurrency-in-ofbiz-tp23810343p23845433.html
Sent from the OFBiz - User mailing list archive at Nabble.com.


Re: How to set-up Multicurrency in ofbiz

Posted by Abhishake Agarwal <ab...@gmail.com>.
Hi,

please look at the link below

http://mail-archives.apache.org/mod_mbox/ofbiz-dev/200810.mbox/%3Ccaaebcd20810122206n2c0261d0t2dbb46ced85c61b5@mail.gmail.com%3E

Regards,
Abhishake

On Mon, Jun 1, 2009 at 11:38 AM, rohit2006 <ro...@yahoo.com> wrote:

>
> Hi,
>
> I have a requirement to show product prices in difference currency. From
> what i understand, ofbiz supports multicurrency, but i have been unable to
> set it up.
>
> I tried the following actions on the demo ofbiz server. I added the price
> in
> GBP for the product ID WG-5569. I did not set the default currency for the
> store to GBP, but instead tried to set default currency for the session
> using the the URI
>
> http://demo.ofbiz.org/ecommerce/products/PROMOTIONS/p_WG-5569?setSessionCurrencyUom?currencyUom=GBP
>
> Still the prices are shown in USD, i will appreciate if someone can help me
> with this.
>
> What i am trying to achieve is, that the default currency should be USD,
> however when user from UK access the products, with URL's amended with
> currency information, the product page should show the prices in GBP
> instead
> of USD.
>
> Thanks for the help.
>
> Rohit
>
> --
> View this message in context:
> http://www.nabble.com/How-to-set-up-Multicurrency-in-ofbiz-tp23810343p23810343.html
> Sent from the OFBiz - User mailing list archive at Nabble.com.
>
>