• Welcome to KonaKart Community Forum. Please login or sign up.
 
April 25, 2024, 11:02:13 pm

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - ReneA

1
Quote from: kate on December 27, 2011, 09:32:10 am
The section in the User Guide "under Configuration of Messages") explains where in the Admin App you can modify the "USE_DB_FOR_MESSAGES" configuration variable and the process for loading messages successfully.

The default state of the kk_msg table is for it to be empty and that doesn't cause the Admin App to crash so I'm not sure what has happened to cause that.

You need to load the messages into the db first, then set the "USE_DB_FOR_MESSAGES" configuration variable then all will be fine.

Maybe you were getting problems because you set the config variable before you loaded the messages and hence KonaKart couldn't find any messages to use...

Anyway...  I'm glad you worked it all out on your own in the end.


Thanks for your reply.

Yes, you are right. I overlooked in the documentation the clue where to find to modify the "USE_DB_FOR_MESSAGES" configuration variable.

Yes, I changed that variable BEFORE loading the messages into the table. Just testing and getting a proof in the front end gui that the table was choosen as source of the messages. And, of course, it did.
2
I've taken the next steps:
- installed standard Konakart 5.5.0.2.
- reviewed the kkMessage utility and supporting scripts
- modified some of these scripts because I've several different versions of standard Konakart running in my development environment
- discovered that there is no Konakart Admin frontend functionality to change "USE_DB_FOR_MESSAGES"
- so I changed it by using phpMyAdmin
- discovered that the webshop frontend now shows the key values of all messages since I've not loaded the messages yet into table kk_msg (so far so good)
- discovered that the admin frontend doesn't like an empty kk_msg table and is therefore crashing
- discovered that loading the messages by means of the kkMessage utility only works whenever "USE_DB_FOR_MESSAGES" is set to false
- discovered that once the message had been loaded into kk_msg and "USE_DB_FOR_MESSAGES" had been set to true, the messages are perfectly picked up by the jsp's from kk_msg table instead of the message property files.

Thanks Konakart Team for enabling this in the application
3
Dear all,

In chapter 8 of the online documentation there is a chapter on the topic "Switching to Database Messages". I like the idea to be able to maintain the messages by the KonakartAdmin front end.

The documentation describes very well how to convert the message fles into a message table within Konakart database. Also the documentation describes that a configuration value must be switched to true.

What I do not understand is:

in the jsp's a bean:message is being used to retrieve the desired message. Once the configuration value has been set to true, will this bean:message statement retrieve he message from the database table ?

the same kind of question applies to accessing the resource bundle, i.e.
ResourceBundle res =
   ResourceBundle.getBundle("MyResource");
String labelOK = res.getString("OK_TEXT"); 

is there an automatic switch to database table messages ?

and what about the Konakart api getCatMessage. Will this api make the right decision to access either the resource bundle or either the database message table ?
4
Check, by means of phpMyAdmin, the contents of table configuration in your konakart database. The contents of column configuration_key is the data you are looking for.
5
You can add the lines marked in red to you jsp.
In the top of the jsp:

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="/tags/struts-bean" prefix="bean" %>
<%@ taglib uri="/tags/struts-html" prefix="html" %>
<%@ taglib uri="/tags/struts-logic" prefix="logic" %>

<bean:define id="kkEng" name="konakartKey" type="com.konakart.al.KKAppEng"/>

<%
  com.konakart.app.KKEng eng;
  com.konakart.app.KKConfiguration conf;

  //Instantiate an object to interface to the main engine
  eng = new com.konakart.app.KKEng();
 
  // Replace with the appropiate config key !!
  conf = eng.getConfiguration("IMAGE_BASE_URL");
  if (conf == null)
  { throw new com.konakart.app.KKException(
            "The Configuration record could not be found.");
  }
  String configValue = conf.getValue();
%>


You may use the config value as in:

<img src="<%=configValue%>images/<%=prod.getImage()%>" border="0" alt="<%=prod.getName()%>" title=" <%=prod.getName()%> " width="<%=kkEng.getSmallImageWidth()%>" height="<%=kkEng.getSmallImageHeight()%>" hspace="5" vspace="5">
6
Ah, thanks.

Checking the "about" of konakartadmin, I'm using version 2.2.4.0.
I checked the coding in Header.jsp of version 3.2.0.0 and saw the differences you pointed out.

Well.... it's time for me to switch to version 3.2.0.0...

Kind regards,
Rene
7
I installed Konakart manually using Tomcat 6. I received an error:
ServletException in '/WEB-INF/jsp/Header.jsp': /WEB-INF/jsp/Header.jsp(49,39) Attribute value n.split(";")[1] is quoted with " which must be escaped when used within the value
org.apache.jasper.JasperException: /WEB-INF/jsp/Header.jsp(49,39) Attribute value n.split(";")[1] is quoted with " which must be escaped when used within the value


I found the solution in this topic: http://base.thep.lu.se/ticket/1081

Tomcat 6.0.18 seems to use a stricter mode for parsing JSP files that what has been used in previous versions. This causes Konakart to fail.

The workaround is to disable the strict parsing mode. This is done by setting a system property in CATALINA_OPTS:
export CATALINA_OPTS="-Xmx500m
-Dorg.apache.jasper.compiler.Parser.STRICT_QUOTE_ESCAPING=false"


Since I'm using Tomcat in a Windows (desktop) environment, I added this setting by means of "Configure..." Tomcat monitor.
Using tab Java I added -Dorg.apache.jasper.compiler.Parser.STRICT_QUOTE_ESCAPING=false" to Java options.

Now it works fine again.
8
Programming of KonaKart / Re: New payment module
October 01, 2008, 08:09:52 pm
Quote from: pete on September 30, 2008, 10:19:59 pm
Hi Rene,

Could you try again please ? I've increased the maximum size to 512 kb.


Thanks Pete, the upload is fine now. See the contributions section.
9
Contributions / KonaKart payment module Enterpayment
October 01, 2008, 08:06:53 pm
Hi KonaKart team and community,

After a period of developing, testing and documenting, I'm happy to present to you the new payment module "EnterPayment". It's based on the gateway of Enterpayment International GmbH (http://www.enterpayment.de/website/index.php?lang=en).

The contribution includes the source files as well as documentation.

I wish to thank the KonaKart team who helped me, in a very quick response, with questions I had.

Feel free to integrate this module into your webshop and send us some feedback.

Regards,
10
Programming of KonaKart / Re: New payment module
September 30, 2008, 08:53:27 pm
Quote from: julie on August 27, 2008, 09:23:09 am
Great. You could be the first payment module contributor  8)


Julie...

I tried to post the contribution files for the new payment module (source code and documentation). But unfortunately, the file size for uploading attachments is limited to 128 Kb ! The size of the zip file is 130 Kb.

Is it possible to increase this limit or should I send you the files by email ?

Regards,
Rene
11
Programming of KonaKart / Re: New payment module
September 09, 2008, 07:46:20 pm
Hello Julie,

I posted a private message to you with some questions about donating the software.
Please, check your inbox in this forum.

Kind regards,
Rene

Quote from: julie on August 27, 2008, 09:23:09 am
Great. You could be the first payment module contributor  8)
12
Programming of KonaKart / Re: New payment module
August 26, 2008, 08:28:25 pm
Quote from: julie on August 26, 2008, 04:15:04 pm
setSelectedAddrFromId() on the client engine is normally called after populateCurrentCustomerAddresses() which saves the customer addresses on the customer object on the session. If the populate method isn't called, then setSelectedAddrFromId() finds an empty address array and throws the exception.


Thank you, Julie,

that was the solution.

The request string for the gateway is now being properly composed and sent out to the gateway. I also receive the result from the gateway. The next step is to parse the response and handle the result.

I will keep you informed.

Once again, thank you for your quick response.

Rene
13
Programming of KonaKart / Re: New payment module
August 26, 2008, 04:01:04 pm
Thanks Julie,

That helped.

By the way, I discovered that Konakart is generating an exception on the following highlighted line of code:
            // Get the billing address
            int billingAddressId = order.getBillingAddrId();
            kkAppEng.getCustomerMgr().setSelectedAddrFromId(billingAddressId);
            AddressIf billingAddress = kkAppEng.getCustomerMgr().getSelectedAddr();

in the following circumstances:
- I'm using Konakart 2.2.4
- I'm NOT using the onepagecheckout (disabled via admin)
- just started Tomcat, so there are no sessions pending, no signed on users
- my test user has 1 item already added in the shopcart (from a previous session)
- the test user does a signon via "My Account"
- then goes to "Checkout"
- hits in screen "Delivery information" the "Continue" button
- hits in screen "Payment information" the "Continue" button
- hits in screen "Order confirmation" the "Confirm order" button
- fills in the credit card details and hits the "Continue" button

Exception Name = com.konakart.al.KKAppException
Exception Message = The current customer has no addresses.
Exception Stack Trace =
at com.konakart.al.CustomerMgr.setSelectedAddrFromId(Unknown Source)
at com.konakart.actions.gateways.EnterpaymentAction.execute(EnterpaymentAction.java:173)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)

Whenever the test user does a "Change billing address" (with or without changing the billing address, the exception does not occur. So it only occurs when accepting the default billing address.

Any ideas what is going on ?

Thanks, Rene
14
Programming of KonaKart / Re: New payment module
August 26, 2008, 10:16:33 am
Thanks Julie,

I've made the choice to retrieve the billing AddressIf by Id from the order:
            // Get the billing address
            int billingAddrId = order.getBillingAddrId();
            kkAppEng.getCustomerMgr().setSelectedAddrFromId(billingAddrId);
            AddressIf billingAddr = kkAppEng.getCustomerMgr().getSelectedAddr();

In that way I'm able to access the proper fields directly:
      xml.append("        <name>" + ba.getFirstName() + "</name>\n");
      xml.append("        <surname>" + ba.getLastName() + "</surname>\n");
      xml.append("        <street>" + ba.getStreetAddress() + "</street>\n");
      xml.append("        <zip>" + ba.getPostcode() + "</zip>\n");
      xml.append("        <city>" + ba.getCity() + "</city>\n");
      xml.append("        <state>" + ba.getState() + "</state>\n");
      xml.append("        <country>" + ba.getCountryName() + "</country>\n");

That works fine. But... the country must be passed as an ISO-3166 country code.
I know, from the administration, see "Locations/Taxes", "Countries" that the 2-letter ISO code is maintained within Konakart tables.

How can I retrieve the CountryIf for the given ba.getCountryId() ? Is or are there any API's in Konakart to be used ?

15
Programming of KonaKart / Re: New payment module
August 25, 2008, 07:49:02 am
Quote from: julie on August 25, 2008, 06:26:29 am
The PaymentDetails object has 5 custom fields that you could use.

Would you consider contributing your gateway to the KonaKart community when you've completed it ?

Thanks,

Julie


Thanks Julie for your reply.
Yes, I would donate the module to the Konakart community, but then I would like to create a nice structured module. I try to avoid using the custom fields.

The gateway protocol is based on xml data passing. In the url parameter xml the request is passed on to the gateway. The result is also returned as xml. So, xml parsing is required.
I already developed the interface coding for another Java project. It is now a matter of integrating into Konakart.

It would be convenient if the PaymentDetails includes the same fields as Addr so that the payment modules can access all fields (in the case of EnterPayment, firstname and lastname) to compose their interface string. In that way it is convenient to let the jsp conditionally show/let edit all these fields (like setShowfirstname, setShowlastname). This jsp is included within the custom modifiable code but the control is via the PaymentDetails interface which is not within the custom code.

Another solution would be to directly access the chosen billing Addr. But I haven't found an Konakart API by which I can retrieve an Addr by Id.

This is what is required by EnterPayment gateway:
card holder
firstname    mandatory
lastname    mandatory
street    mandatory
zip/Postal    mandatory
city            mandatory
state    partly mandatory This field is mandatory, when the customer comes from the USA, Canada or Australia. For all other countries this field should be empty. See appendix for allowed values
country    mandatory    ISO-3166 country code. See appendix for allowed values
telephone    optional
email      mandatory
ip            optional