• Welcome to KonaKart Community Forum. Please login or sign up.
 

No newProducs after SetLocale_xx_XX.do !?

Started by lrkwz, December 09, 2009, 09:17:03 pm

Previous topic - Next topic

lrkwz

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:


It seems that the prodMgr's newProducts property is empty at firrst access if forwarded from SetLocale_xx_XX.do

lrkwz

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>

Sony George

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:


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

lrkwz

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!

lrkwz


Sony George

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);


lrkwz

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 :-(

lrkwz

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.

Sony George

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


Sony George

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());%>