Hi
I'm customly populating the order from the basket but somehow I don't think I get the shipping cost populated correctly
I'm doing this:
// Attach the shipping quote to the order
kkAppEng.getOrderMgr().addShippingQuoteToOrder("quoteflat");
(Flat shipping configured via admin)
// Populate the checkout order with order totals
kkAppEng.getOrderMgr().populateCheckoutOrderWithOrderTotals();
Am I missing something ?
Many thanks in advance,
Mika
If you are doing about the same and it's working, I'd be happy to know about it.
If you are doing something different, please infom.
Thanks again
Mika
I suggest you either look at the struts action classes where we create an order or you follow the example (InsertOrder.java) which you can find under KonaKart\java_api_examples\src\com\konakart\apiexamples .
Thanks for the pointer! I will look into it!
Many thanks
I got it working!
I checked CheckoutDeliveryAction and realised that I have to create the shipping quotes before inserting one into the check out order:
// Get shipping quotes from the engine
kkAppEng.getOrderMgr().createShippingQuotes();
// Get shipping quotes for the order and choose the first one in the list for this order
ShippingQuoteIf[] sQuotes = kkAppEng.getOrderMgr().getShippingQuotes();
if (sQuotes != null && sQuotes.length > 0)
{
checkoutOrder.setShippingQuote(sQuotes[0]);
System.out.println("shipping = " + sQuotes[0]);
}
// Populate the checkout order with order totals
kkAppEng.getOrderMgr().populateCheckoutOrderWithOrderTotals();
Many thanks!
Konakart is kewl 8)