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:
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.
In order to save an order, we do:
Code Select
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.