hi,
in my store I have set EUR as the "Default Currency Uom Id". All prices are in Euro too. The problem is: 1.) When I visit the shop and am not logged in I can add a product to the shopping cart. 2.) When I login I can add a product to the shopping cart. 3.) When I logout again I CANNOT add an item. The error message is "Could not find a valid price for the product with ID [10001_x_y], not adding to cart." (this error is thrown in ShoppingCartItem.updatePrice() ). 4.) When I close the browser and open a new window I can add a product to the cart again. I stepped through the code and I found out that in case 1., 2. and 4. the currencyUomId of the ShoppingCart Object that is passed to ShoppingCartItem.updatePrice() is set to "EUR". When I login and then logout again this is not the case anymore, it is set to "USD". Could this be a bug or did I misconfigure something? I'm using rev 6670. kind regards, Anna -- Bis zu 70% Ihrer Onlinekosten sparen: GMX SmartSurfer! Kostenlos downloaden: http://www.gmx.net/de/go/smartsurfer _______________________________________________ Users mailing list [hidden email] http://lists.ofbiz.org/mailman/listinfo/users |
ok, I explored this a little longer....
In ShoppingCartEvents.getCartObject() UtilHttp.getCurrencyUom is called. The problem is that the session seems to have lost the attribute "currencyUom" and so USD is used as a default value. I could simply change this to EUR but.. somehow that doesn't seem to be a nice solution ;) I can't find the place where the currency is set into the session for the first time so I'm stuck now. public static String getCurrencyUom(HttpSession session) { // session, should override all if set there String iso = (String) session.getAttribute("currencyUom"); // check userLogin next, ie if nothing to override in the session if (iso == null) { Map userLogin = (Map) session.getAttribute("userLogin"); if (userLogin == null) { userLogin = (Map) session.getAttribute("autoUserLogin"); } if (userLogin != null) { iso = (String) userLogin.get("lastCurrencyUom"); } } // if none is set we will use the configured default if (iso == null) { try { iso = UtilProperties.getPropertyValue("general", "currency.uom.id.default", "USD"); } catch (Exception e) { Debug.logWarning("Error getting the general:currency.uom.id.default value: " + e.toString(), module); } } // if still none we will use the default for whatever locale we can get... if (iso == null) { Currency cur = Currency.getInstance(getLocale(session)); iso = cur.getCurrencyCode(); } return iso; } > --- Ursprüngliche Nachricht --- > Von: [hidden email] > An: [hidden email] > Betreff: [OFBiz] Users - curreny other than USD not set after logout > Datum: Thu, 2 Mar 2006 13:25:29 +0100 (MET) > > hi, > > in my store I have set EUR as the "Default Currency Uom Id". All prices > are > in Euro too. The problem is: > > 1.) When I visit the shop and am not logged in I can add a product to the > shopping cart. > 2.) When I login I can add a product to the shopping cart. > 3.) When I logout again I CANNOT add an item. The error message is "Could > not find a valid price for the product with ID [10001_x_y], not adding to > cart." (this error is thrown in ShoppingCartItem.updatePrice() ). > > 4.) When I close the browser and open a new window I can add a product to > the cart again. > > > I stepped through the code and I found out that in case 1., 2. and 4. the > currencyUomId of the ShoppingCart Object that is passed to > ShoppingCartItem.updatePrice() is set to "EUR". When I login and then > logout > again this is not the case anymore, it is set to "USD". Could this be a > bug > or did I misconfigure something? > > > I'm using rev 6670. > > > > kind regards, > Anna > > > -- > Bis zu 70% Ihrer Onlinekosten sparen: GMX SmartSurfer! > Kostenlos downloaden: http://www.gmx.net/de/go/smartsurfer > > _______________________________________________ > Users mailing list > [hidden email] > http://lists.ofbiz.org/mailman/listinfo/users > -- Bis zu 70% Ihrer Onlinekosten sparen: GMX SmartSurfer! Kostenlos downloaden: http://www.gmx.net/de/go/smartsurfer _______________________________________________ Users mailing list [hidden email] http://lists.ofbiz.org/mailman/listinfo/users |
Anna,
Have you changed the default currency? framework/common/config/general.properties:currency.uom.id.default=USD -- Kind Regards Andrew Sykes <[hidden email]> Sykes Development Ltd http://www.sykesdevelopment.com _______________________________________________ Users mailing list [hidden email] http://lists.ofbiz.org/mailman/listinfo/users |
aargh... but this time I was at least close.. ;)
Thank you Andrew, that solved the problem!! (I didn't expect that I would have to change this in 2 different places) > --- Ursprüngliche Nachricht --- > Von: Andrew Sykes <[hidden email]> > An: OFBiz Users / Usage Discussion <[hidden email]> > Betreff: Re: [OFBiz] Users - curreny other than USD not set after logout > Datum: Thu, 02 Mar 2006 13:33:55 +0000 > > Anna, > > Have you changed the default currency? > > framework/common/config/general.properties:currency.uom.id.default=USD > -- > Kind Regards > Andrew Sykes <[hidden email]> > Sykes Development Ltd > http://www.sykesdevelopment.com > > > _______________________________________________ > Users mailing list > [hidden email] > http://lists.ofbiz.org/mailman/listinfo/users > -- Bis zu 70% Ihrer Onlinekosten sparen: GMX SmartSurfer! Kostenlos downloaden: http://www.gmx.net/de/go/smartsurfer _______________________________________________ Users mailing list [hidden email] http://lists.ofbiz.org/mailman/listinfo/users |
Free forum by Nabble | Edit this page |