HI,
Well i am trying to add the product in the basket, saving it and then trying to rerive back. On save of basket, basket item save in teh database but when i retrieve the basket per customer, no basket items comes as well the basket item from db is also removed. Below is my code snipplet
//initialize the konakart end services and login to the konakart. See below the implement
initKona();
//get the product
Product product = getKkwsEngIf().getProduct(getSessionID(),Integer.valueOf(getEventFromSession(request, response).getTicketID()).intValue(), -1);
// create the basket
Basket basket=new Basket();
basket.setProduct(product);
basket.setProductId(product.getId());
//set quantity from the product custom attr which i have setted previously
if(product.getCustom1()!=null)
basket.setQuantity(Integer.valueOf(product.getCustom1()).intValue());
//set quantity
basket.setQuantityInStock(product.getQuantity());
//add basket. after this, the basket get reflected in db
int addToBasket = getKkwsEngIf().addToBasket(getSessionID(), 1, basket);
// get the basket items here. After this the basket items get removed from db. Also the basket items are //not coming
Basket[] basketItemsPerCustomer = getKkwsEngIf().getBasketItemsPerCustomer(getSessionID(), 1, -1);
//initkona implementation
if (kkwsAdmin == null) {
KKWSAdminIfServiceLocator kkwsAdminIfServiceLocator = new KKWSAdminIfServiceLocator();
kkwsAdmin = kkwsAdminIfServiceLocator.getKKWSAdmin();
}
if(kkwsEngIf == null){
KKWSEngIfServiceLocator kkwsEngIfServiceLocator=new KKWSEngIfServiceLocator();
kkwsEngIf=kkwsEngIfServiceLocator.getKKWebServiceEng();
}
sessionID = kkwsAdmin.login("admin@konakart.com", "princess");
I am using the SOAP to perform all these operation. Please help..
Regards,
Vaibhav
Try setting the basket quantity rather than the quantityInStock.