Hi Josip, The missing request-map is certainly a missing aspect in current feature set of both the 12.x and other (incl. soon to be released) versions.
Would you care to create a JIRA issue to have it resolved and incorporated in future releases? And attach your solution as a patch? Best regards, Pierre Smits *ORRTIZ.COM <http://www.orrtiz.com>* Services & Solutions for Cloud- Based Manufacturing, Professional Services and Retail & Trade http://www.orrtiz.com On Wed, Sep 10, 2014 at 10:56 AM, Josip Almasi <[email protected]> wrote: > Hi all, > > I've found out that I can use only one currency per shop. > But I prefer to let user change the currency, just like the language. > Googling was of no help, so here's how I did it, might save someone some > time. > (I'm talking about ofbiz 12; newer didn't work for me) > > By analyzing eccommerce controller.xml and appropriate java code, I found > out there is a way to set session currency, with a get request: > ECOMMERCEURL/control/setSessionCurrencyUom?currencyUom=UOMID > > However, shopping cart igores session currency. That can be demonstrated > by changing minicart.ftl, like this: > > <div id="minicart"> > <h3>${uiLabelMap.OrderCartSummary} ${Request.currencyUomId} > ${shoppingCart.getCurrency()} <@ofbizCurrency > amount=shoppingCart.getDisplayGrandTotal() > isoCode=shoppingCart.getCurrency()/></h3> > > I also found methods in place to set shopping cart currency. > Just, they were not mapped to any requests in eccommerce controller.xml. > So here's how I mapped it: > > <request-map uri="setCurrency"> > <security https="false" auth="false"/> > <event type="java" > path="org.ofbiz.order.shoppingcart.ShoppingCartEvents" > invoke="setCurrency"/> > <response name="success" type="request-redirect" > value="fromSetSessionLocale"/> > <response name="error" type="view" value="main"/> > </request-map> > > This allows changing shopping cart currency with a get request like: > ECOMMERCEURL/control/seCurrency?currencyUomId=UOMID > > I'm not really sure about that fromSetSessionLocale redirect, but so far > it seems to work. > > Regards... >
