Hi,

I have one more query related to this,

Suppose I changed currency from $ to £ now all products prices, whose
currencies has been configured in £ will be displayed.

Problem come when we are on checkout screen as for shipping method cost is
configured with single currency.

example: if shipping method cost is 20 $ then it will display 20 £ which is
incorrect (its just change the sign not the value).

Please let me know is there a fix to it.

Regards,
Abhishake

On Mon, Oct 13, 2008 at 10:36 AM, Abhishake Agarwal <
[EMAIL PROTECTED]> wrote:

> Hi,
>
> I have resolved the issue actually currency should be set to shopping cart
> object also.
>
> I have modified the setSessionCurrencyUom method as below and it was
> working fine
>
> public static String setSessionCurrencyUom(HttpServletRequest request,
> HttpServletResponse response) {
>         String currencyUom = request.getParameter("currencyUom");
>         LocalDispatcher dispatcher = (LocalDispatcher)
> request.getAttribute("dispatcher");
>         if (UtilValidate.isNotEmpty(currencyUom)) {
>             // update the session
>             UtilHttp.setCurrencyUom(request.getSession(), currencyUom);
>
>             // update the UserLogin object
>             GenericValue userLogin = (GenericValue)
> request.getSession().getAttribute("userLogin");
>             if (userLogin == null) {
>                 userLogin = (GenericValue)
> request.getSession().getAttribute("autoUserLogin");
>             }
>
>             if (userLogin != null) {
>                 GenericValue ulUpdate = GenericValue.create(userLogin);
>                 ulUpdate.set("lastCurrencyUom", currencyUom);
>                 try {
>                     ulUpdate.store();
>                     userLogin.refreshFromCache();
>
>                 } catch (GenericEntityException e) {
>                     Debug.logWarning(e, module);
>                 }
>                 ShoppingCart cart =
> ShoppingCartEvents.getCartObject(request);
>                 try {
>                     cart.setCurrency(dispatcher,currencyUom);
>                 } catch (CartItemModifyException e) {
>                     Debug.logWarning(e, module);
>                 }
>             }
>         }
>         return "success";
>     }
>
> Regards,
> Abhishake
>
>
> On Mon, Oct 13, 2008 at 2:16 AM, Jacques Le Roux <
> [EMAIL PROTECTED]> wrote:
>
>> I also tried in UI (nothing happens as far as I can tell), and looked
>> after at the code. I ran out of time but it seems that OOTB only the Product
>> Store Currency is taken into account (through
>> ProductStoreWorker.getStoreCurrencyUomId when the
>> WebShoppingCart is created). So you would have to re-create your
>> WebShoppingCart passing your currency from the Session
>>
>> Please use rather user ML for such questions :
>>
>> http://docs.ofbiz.org/display/OFBADMIN/Mailing+Lists#MailingLists-DeveloperList:[email protected]
>>
>> Thanks
>>
>> Jacques
>>
>> From: "Abhishake Agarwal" <[EMAIL PROTECTED]>
>>
>>  Hi,
>>>
>>> I tried following URL to set currency but it is not working
>>>
>>>
>>> http://demo.hotwaxmedia.com/ecommerce/control/setSessionCurrencyUom?currencyUom=INR
>>>
>>> Regards,
>>> Abhishake
>>>
>>> On Sun, Oct 5, 2008 at 10:36 PM, Abhishake Agarwal <
>>> [EMAIL PROTECTED]> wrote:
>>>
>>>  Hi,
>>>>
>>>> I want to know whether it is possible to set currency dynamically.
>>>>
>>>> Suppose on ecommerce application, I have a currency options and if user
>>>> select any of the type of currency, application should set that currency
>>>> for
>>>> that user.
>>>>
>>>> Regards,
>>>> Abhishake
>>>>
>>>>
>>>
>>
>

Reply via email to