• Welcome to KonaKart Community Forum. Please login or sign up.
 
May 03, 2024, 06:46:19 am

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 - vpod

1
The KKEngIf has 2 ways of sending a confirmation mail, According to the javadoc:


  • void sendOrderConfirmationEmail(java.lang.String sessionId, int orderId, java.lang.String mailSubject, int languageId)

  • EmailIf sendOrderConfirmationEmail1(java.lang.String sessionId, int orderId, int langIdForOrder, EmailOptionsIf options)



Im trying to use the second one. But, I dont know how to set the mailSubject. Any Idea?

Thanks
2
perhaps:

KKWSEngIf eng = new KKWSEngIfServiceLocator().getKKWebServiceEng();


int languageId = 1;
String searchString = "a%";
String sessionId = ""; //get the sessionid

List<Product> products = new ArrayList<Product>();

List<Record> records;
try {
Torque.init("torque.properties");

records = BasePeer
  .executeQuery("SELECT pd.products_id " +
"FROM konakart.products_description pd " +
"where pd.products_name like '" + searchString + "' " +
"and pd.language_id = " + languageId);

if (records != null) {
for (Iterator<Record>
         iterator = records.iterator();
         iterator.hasNext();)
{
Record rec = (Record) iterator.next();
int productId = rec.getValue(0).asInt();
Product prod = eng.getProduct(sessionId, productId, languageId)

products.add(prod);
}
}
} catch (TorqueException e) {
e.printStackTrace();
} catch (DataSetException e) {
e.printStackTrace();
}


...handmade

3
More information... perhaps someone can help me...

I debug the payment method when is invoked:

Inside the method "public PaymentDetails getPaymentDetails(Order order, PaymentInfo info)"

- order object:

deliveryCountry   = "Aruba"   
deliveryState   "test"   
deliveryZoneObject null   

- info object:
  deliveryGeoZoneArray = null   (I expected to be the geo_zone 7)

If a check inside the database the geo_zone_id=7:

SELECT
zone_country_id,
zone_id,
geo_zone_id,
countries_name
FROM
zones_to_geo_zones z,
countries c
where
z.geo_zone_id=7
and c.countries_id = z.zone_country_id


Result:


























zone_country_idzone_idgeo_zone_idcountries_name
1107Armenia
1207Aruba
3007Brazil


As final response I get on the log:

QuoteWARN  (?:getPaymentGatewaysPrivate:?) Called the getPaymentDetails method on module com.konakart.bl.modules.payment.westernunion.Westernunion. The module isn't available because of the following problem: The delivery address of the order is not within the GeoZone, id = 7


Clues?
4
Hello,

I have 2 tax zones:

Zone "A": Includes a group of countries. - for example "Albania", "Spain".
Zone "B": Include 1 country - for explample: "Albania".  (that is included in the Zone "A").

When a customer belongs to the zone "A" he can select 2 payment methods ("Y", "Z").
When a customer belongs to the zone "B" he, also, can select the "X" payment methods.

All payment methods can be only part of one zone (as far as I know).


P. Method --> Zone
X -> B
Y -> A
Z -> A

But when I create an order with a customer from "Albania" I only see the "X", and not (as I expected) "X", "Y", "Z".

Any idea?
5
I created a jsp page that allows selecting different payment methods. When the user changes his address the payment methods must be changed according to that.

I'm having troubles to make these works. When I change the address, the payment methods don't change. I made the following example. what am I making wrong?

<%@ page language="java" contentType="text/html; charset=UTF-8"%>
<%@ page import="
java.util.*,
java.text.*,
java.lang.*,
com.konakart.ws.*,
com.konakart.wsapp.*,
com.konakart.app.*" %>


<%


KKWSEngIf eng = new KKWSEngIfServiceLocator().getKKWebServiceEng();


String sessionId = eng.login("konakartUserName", "konakartPassword");

Basket basket = new Basket();
basket.setProductId(30);
basket.setQuantity(1);

eng.addToBasket(sessionId, -1, basket);

Basket[] basketItems = eng.getBasketItemsPerCustomer(sessionId,-1,-1);

Order order = eng.createOrder(sessionId,basketItems,-1);

Address[] addresses = eng.getAddressesPerCustomer(sessionId);

Address address = addresses[0];

PaymentDetails[] metodosPago = eng.getPaymentGateways(order,-1);

%>
Payment methods From Argentina<p>
<%

for (int j=0; j< metodosPago.length;j++)
{
PaymentDetails mPago = metodosPago[j];
%>
<%=mPago.getDescription() %><br>
<%
}

address.setCountryName("Canada");
address.setState("Quebec");

order = eng.changeDeliveryAddress(sessionId,order,address);

metodosPago = eng.getPaymentGateways(order,-1);

%>
<p> Payment methods From Canada<p>
<%
for (int j=0; j< metodosPago.length;j++)
{
PaymentDetails mPago = metodosPago[j];
%>
<%=mPago.getDescription() %><br>
<%
}

%>
6
Well, I figured it out.
I'll share the solution with you. it may be usefull for someone else:

KKWSAdminIf adm = new KKWSAdminIfServiceLocator().getKKWSAdmin();

List<AdminOrder> ordenes = new ArrayList<AdminOrder>();

List<Record> records;
try {
Torque.init("torque.properties");

records = BasePeer
  .executeQuery("select orders_id, products_id " +
                       "from orders_products " +
                       "where products_id = " + products_id);

if (records != null) {
for (Iterator<Record>
         iterator = records.iterator();
         iterator.hasNext();)
{
Record rec = (Record) iterator.next();
int orders_id = rec.getValue(1).asInt();
AdminOrder orden = adm.getOrderForOrderId(sessionId, orders_id);
ordenes.add(orden);
}
}
} catch (TorqueException e) {
e.printStackTrace();
} catch (DataSetException e) {
e.printStackTrace();
}
7
Hello,

I need to create a jsp that shows a group of orders that contains a product.
Is there any way to make this using some api function?

Thanks.
Vpod
8
You just need to put the cupon code in the order and later save it:

KKWSEngIf eng = new KKWSEngIfServiceLocator().getKKWebServiceEng();
Basket[] basketItems = eng.getBasketItemsPerCustomer(sessionId,-1,-1);

Order order = eng.createOrder(sessionId,basketItems,-1);

String cupon = "QWERTY";
order.setCouponCode(cupon);

[...]

orderId = eng.saveOrder(sessionId, order, -1);


Ther order is not saved in the database until you save it. Unless you use the createAndSaveOrder method.

Quote from: diyhs on November 26, 2009, 12:54:54 am
I am using the WS API of Konakart 4.1 to implement a check-out feature for a companion site for my store.

From my companion site, I am instantiating a KKWSEngIf object using:
KKWSEngIf kkEng = new KKWSEngIfServiceLocator().getKKWebServiceEng();

Using the kkEng object, I create an order using the createOrder method, passing Basket items that had been selected.  This all works beautifully.  I am also able to use the order.getOrderTotals() method to display the shipping and taxes calculated for these items (which was the whole purpose for using the shopping cart from Konakart in the companion site to begin with!).

My problem is that now that I have all of this information (the basket items, the order totals, shipping, etc), I am displaying it to the end-user and providing them with a "coupon" field to receive discounts.  That is all good, except that when I then try to apply that coupon (which has been associated in the Konakart store with a promotion that applies to these products), I can't seem to find any method within the WS API to be able to apply it to an existing order! 

I have tried to find ways around this by not doing the createOrder() method until after I have the coupon, but that doesn't work very well from a usability perspective, since I need to show them what they are ordering and how much it costs prior to getting the coupon information.

And once the createOrder is called, the order is in the order DB of the store and can't seem to be modified except for a limited set of attributes (none of which are the couponCode).  I guess an option would be to delete the previous order and create a new one with the coupon code, but this seems to be a lot of service call thrashing!

Does anyone have any suggestions?

BTW, on a somewhat related note, the javadoc for createOrder implies it doesn't save the order to the database until the saveOrder method is called.  However, this is not the case and the db is populated with the order after the createOrder method.  The saveOrder method seems to have no function whatsoever...


9
After several hours of work I did create a new Payment method called "monthly instalments". A customer using this method must select a number of instalments. I store this value in the costum Value 1 of the paymentDetails object.

While I have the order in memory I can get the number of instalments. But after saving the order and trying to load it, I can not get the saved value.

This is how I set the value:

QuotePaymentDetails[] payMethods = eng.getPaymentGateways(order,-1);

PaymentDetails mPay = payMethods[0];
mPay.setCustom1(instalments);

order.setPaymentDetails(mPay);

orderId = eng.saveOrder(sessionId, order, -1);


This is how I tried to get the value back:

QuoteOrder order = eng.getOrder(sessionId,orderId,-1);
PaymentDetails pd = eng.getPaymentGateway(order,order.getPaymentModuleCode(),-1);
String instalments = pd.getCustom1();


But getCustom1() is null. Is It posible that this value is never stored in the database?

Vpod
10
I'm having the same problem. I created a new order total module and I get the "java.lang.ClassNotFoundException".
Did you manage to solve it?

Quote from: jiaqiangyan on March 19, 2008, 06:45:42 am
Kate,

I copy the exsiting one (SubTotal) ......  , and it works,

but  when I set the "Sort Order" property to another number on Admin APP,
I got the exception message:


19-Mar 14:37:18 INFO  (?:run:?) Refreshing Config Variables
java.lang.ClassNotFoundException: com.konakart.bl.modules.ordertotal.ot_eryijuordertotal.Ot_eryijuordertotal
        at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1358)
        at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1204)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:169)
        at com.konakart.bl.modules.ordertotal.OrderTotalMgr.refreshConfigs(Unknown Source)
        at com.konakart.app.KKEng.updateCachedConfigurations(Unknown Source)
        at com.konakart.al.ConfigCacheUpdater.run(Unknown Source)
19-Mar 14:37:48 INFO  (?:run:?) Refreshing Config Variables
java.lang.ClassNotFoundException: com.konakart.bl.modules.ordertotal.ot_eryijuordertotal.Ot_eryijuordertotal
        at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1358)
        at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1204)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:169)
        at com.konakart.bl.modules.ordertotal.OrderTotalMgr.refreshConfigs(Unknown Source)
        at com.konakart.app.KKEng.updateCachedConfigurations(Unknown Source)
        at com.konakart.al.ConfigCacheUpdater.run(Unknown Source)
11
yes. I named it "konakartExtensions.jar".
I debug with eclipse and the module is loaded in both applications.

The error displays

QuoteCould not instantiate the OrderTotal Module com.konakart.bl.modules.ordertotal.ot_intereses.Ot_INTERESES


but my modules is "Intereses".

I think the problems key is here:

Quotejava.lang.ClassNotFoundException: com.konakart.bl.modules.ordertotal.ot_intereses.Ot_INTERESES
[...]
at com.konakart.bl.modules.ordertotal.OrderTotalMgr.getOrderTotalModuleForName(Unknown Source)

12
I checked it. The value is correct. The "Intereses" OrderTotal Module appears in the admin correctly, but the error still persists.
14
I'm trying to create a new order total and I having the following error:

Quote09-Dec 18:13:36 ERROR (?:getOrderTotals:?) Could not instantiate the OrderTotal Module com.konakart.bl.modules.ordertotal.ot_intereses.Ot_INTERESES
java.lang.ClassNotFoundException: com.konakart.bl.modules.ordertotal.ot_intereses.Ot_INTERESES
   at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1362)
   at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1208)
   at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
   at java.lang.Class.forName0(Native Method)
   at java.lang.Class.forName(Class.java:169)
   at com.konakart.bl.modules.ordertotal.OrderTotalMgr.getOrderTotalModuleForName(Unknown Source)
   at com.konakart.bl.modules.ordertotal.OrderTotalMgr.getOrderTotals(Unknown Source)
   at com.konakart.app.KKEng.getOrderTotals(Unknown Source)
   at com.konakart.app.KKEng.getOrderTotals(Unknown Source)
   at com.konakart.ws.KKWebServiceEngSoapBindingImpl.getOrderTotals(Unknown Source)
   at com.konakart.ws.KKWebServiceEngSoapBindingSkeleton.getOrderTotals(Unknown Source)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at org.apache.axis.providers.java.RPCProvider.invokeMethod(RPCProvider.java:397)
   at org.apache.axis.providers.java.RPCProvider.processMessage(RPCProvider.java:186)
   at org.apache.axis.providers.java.JavaProvider.invoke(JavaProvider.java:323)
   at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
   at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
   at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
   at org.apache.axis.handlers.soap.SOAPService.invoke(SOAPService.java:454)
   at org.apache.axis.server.AxisServer.invoke(AxisServer.java:281)
   at org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:699)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
   at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172)
   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
   at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874)
   at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
   at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
   at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
   at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
   at java.lang.Thread.run(Thread.java:619)


I created the class "Intereses" in the package "com.konakartadmin.modules.ordertotal.intereses" and the class "Intereses" in "com.konakart.bl.modules.ordertotal.intereses". The new order total is installed in the konakartadmin. but when the konakart start the error appears.

What am I missing?


More information: I attached the classes.

Vpod
15
Hello, this is my first message in this forum. Spanish is my first language, so I'll try as hard as I can to explain my problem in English.

I'm developing a project using opencms + konakart. The idea was to integrate a store (konakart) into an existing site (opencms). I decided to use the kkeng from jsp pages to create a better integration.

At this moment I:

- integrated the user login konakart-opencms
- made some jsp that shows the products
- made some jsp that creates the cart.
- made some jsp to select the shipping and payment methods
- made some jsp to confirm and save the order.

At this point I'm waiting for the actionclass from the payment method to work. But nothing happens.
I understand this is not posible becouse of the topic "http://www.konakart.com/forum/index.php/topic,719.0.html";

Did someone find a way to achive this? Do I have to bypass the payment mechanism and make it outside konakart?

Thanks
vpod