If as firsts action in a new instance of a browser i go to http://localhost:8780/konakart/SetLocale_it_IT.do I am forwarded to Welcome.do with no newProducts.
If I go to http://localhost:8780/konakart/Welcome.do then to http://localhost:8780/konakart/SetLocale_it_IT.do I'm redirected back to the Welcome.do page correctly populated.
I do not want users to have to choose their interface language so I would like to define two virtual hosts such as:
- www.mysite.com --> forwards requests to Tomcat/kk
- www.mysite.it --> redirect to www.mysite.com/konakart/SetLocale_it_IT.do
It seems that the prodMgr's newProducts property is empty at firrst access if forwarded from SetLocale_xx_XX.do
Same proble even if I configure in struts-config
<action path="/SetLocale_it_IT" type="com.konakart.actions.SetLocaleAction" parameter="it_IT">
<forward name="SetLocale" path="/CatalogMainPage.do" redirect="true"/>
</action>
Quote from: lrkwz on December 09, 2009, 09:17:03 pm
If as firsts action in a new instance of a browser i go to http://localhost:8780/konakart/SetLocale_it_IT.do I am forwarded to Welcome.do with no newProducts.
If I go to http://localhost:8780/konakart/Welcome.do then to http://localhost:8780/konakart/SetLocale_it_IT.do I'm redirected back to the Welcome.do page correctly populated.
I do not want users to have to choose their interface language so I would like to define two virtual hosts such as:
- www.mysite.com --> forwards requests to Tomcat/kk
- www.mysite.it --> redirect to www.mysite.com/konakart/SetLocale_it_IT.do
It seems that the prodMgr's newProducts property is empty at firrst access if forwarded from SetLocale_xx_XX.do
I also face this problem, but the main problem for me is,
this do not happen always, still did not get a chance to re-produce this problem for a debug
to report to konakart
Here are few simple steps to reproduce the problem.
- Start mysql
- Start konakart
- Start browser
- go to http://localhost:8780/konakart/SetLocale_de_DE.do
Menu is in german (so you can verify locale has benn changed correctly).
The page shows no products.
Thank click ok Konakart logo (goto Welcome.do), product list appears!
No comments? I think THIS is a bug
Quote from: lrkwz on December 10, 2009, 05:39:36 pm
No comments? I think THIS is a bug
a work around for this is to add these line just before
return mapping.findForward("SetLocale"); of SetLocaleAction.java
// Get the new products for all categories
kkAppEng.getProductMgr().fetchNewProductsArray(ProductMgr.DONT_INCLUDE);
Ok thank you ... quite fixed ... still the name of the products is in the site default language ...
I've tried kkAppEng.SetLangId() with no success :-(
Got it!
In webapps/konakart/WEB-INF/jsp/NewProductsWithDetail.jsp
39 <div class="tile-content">
40 <table class="tile-content" width="98%">
41 <% int i=0; %>
42 <tr>
43 <logic:iterate id="prod" name="prodArray" length="maxRows" type="com.konakart.appif.ProductIf">
44 <%prod = kkEng.getEng().getProductWithOptions(kkEng.getSessionId(),prod.getId(),-1, kkEng.getFetchProdOptions());%>
Remove line 44 which overwrites prod with default language contents.
Quote from: lrkwz on December 14, 2009, 10:10:23 pm
Got it!
In webapps/konakart/WEB-INF/jsp/NewProductsWithDetail.jsp
39 <div class="tile-content">
40 <table class="tile-content" width="98%">
41 <% int i=0; %>
42 <tr>
43 <logic:iterate id="prod" name="prodArray" length="maxRows" type="com.konakart.appif.ProductIf">
44 <%prod = kkEng.getEng().getProductWithOptions(kkEng.getSessionId(),prod.getId(),-1, kkEng.getFetchProdOptions());%>
Remove line 44 which overwrites prod with default language contents.
replace the line 44 with this
44 <%prod = kkEng.getEng().getProductWithOptions(kkEng.getSessionId(),prod.getId(),
kkAppEng.getLangId(), kkEng.getFetchProdOptions());%>
when -1 is passed, the default language set in the admin app is used to get the content
kkAppEng.getLangId() gives the current language in the logged in user session
Quote from: Sony George on December 15, 2009, 04:49:10 am
Quote from: lrkwz on December 14, 2009, 10:10:23 pm
Got it!
In webapps/konakart/WEB-INF/jsp/NewProductsWithDetail.jsp
39 <div class="tile-content">
40 <table class="tile-content" width="98%">
41 <% int i=0; %>
42 <tr>
43 <logic:iterate id="prod" name="prodArray" length="maxRows" type="com.konakart.appif.ProductIf">
44 <%prod = kkEng.getEng().getProductWithOptions(kkEng.getSessionId(),prod.getId(),-1, kkEng.getFetchProdOptions());%>
Remove line 44 which overwrites prod with default language contents.
replace the line 44 with this
44 <%prod = kkEng.getEng().getProductWithOptions(kkEng.getSessionId(),prod.getId(),kkAppEng.getLangId(), kkEng.getFetchProdOptions());%>
when -1 is passed, the default language set in the admin app is used to get the content
kkAppEng.getLangId() gives the current language in the logged in user session
Sorry for the mistake, it is not
kkAppEng.getLangId() it is
kkEng.getLangId()44 <%prod = kkEng.getEng().getProductWithOptions(kkEng.getSessionId(),prod.getId(),
kkEng.getLangId(), kkEng.getFetchProdOptions());%>