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

Multi-Store and getOrderTotals(...)

Started by elisabeth, October 21, 2010, 12:18:57 pm

Previous topic - Next topic

elisabeth

Hello, we are having a problem with the getOrderTotals in a multi-store deployment (mode 2, shared customers and products).

In order to save an order, we do:

KKEngIf kkEngine = getKonakartEngineImpl(storeId);
OrderIf order = kkEngine.createOrder(sessionId, items, languageId);
order = kkEngine.getOrderTotals(order, languageId);
// Set addresses, custom fields, ...
kkEngine.saveOrder(order);


Where getKonakartEngineImpl(...) is a helper function which instantiates a KKWSEng object with an EngineConfiguration for the given storeId, e.g. getKonakartEngineImpl("store1") gives you an engine connected to store1.

Now, the above code works perfectly if storeId = "store1", but it fails for storeId = "store2" with the message "the order needs at least one OrderTotal object". It looks like kkEngine.getOrderTotals(...) silently fails for the second store, even though we have the same order total module configuration in both stores. We also tried installing additional modules, removing others etc. but the problem remains the same.

If we simply let the order totals be generated by the kkEngine for store1 and then copy them over to the order to be saved in store2, Konakart allows me to save the order but if we try to look at it in Konakartadmin we get a NullPointerException in the ot_total module.

Any pointers as to how we could solve this?

Thank you for your time.

michaelwechner

Hi

I receive the following exception when calling  kkEngineBranch.createOrder(sessionId, items, languageId);

com.konakart.app.KKException: java.rmi.RemoteException: java.lang.reflect.InvocationTargetException; nested exception is:
        java.lang.reflect.InvocationTargetException
com.konakart.app.KKException: java.rmi.RemoteException: java.lang.reflect.InvocationTargetException; nested exception is:
        java.lang.reflect.InvocationTargetException
        at com.konakart.ws.KKWebServiceSoapMgr.createKKAdminExceptionFromAxisFault(Unknown Source)
        at com.konakart.app.KKWSEng.manageThrowable(Unknown Source)
        at com.konakart.app.KKWSEng.createOrder(Unknown Source)


whereas kkEngineBranch is the engine of store2

I will try to narrow down what is causing this problem and keep you posted, but any pointers are much
appreciated.

Thanks

Michael

michaelwechner

Hi

I think we have finally figured out how to make this work. The reason that it wasn't working was that
we didn't really understand how multi store with a single data base is actually working:

- It's important to understand that even if "shared products" is enabled, one still has to actually share a product by clicking on the product within the store one has created it, and then click on the tab stores and select all the stores which you want to share it with

- Also it's important to understand that categories are not shared and that if you share a product created within store1 with store2, then one needs to assign a category within store2 in order that one can actually order it.

Having said this, we can now do orders based on ZIP codes which are then added to a speicifc store accordingly, but it doesn't really solve our problem in a nice way, because every time the product manager is creating a new product then she/he has to share it with all other stores and then assign within each store the product with a category, which means if you have many stores representing certain ZIP code ranges, then this is quite some
overhead for the product manager.

Maybe we will find some workarounds, and keep you posted on our progress.

HTH

Michael