KonaKart Community Forum

Installation / Configuration => Programming of KonaKart => Topic started by: tduffey on July 06, 2016, 04:20:52 am

Title: Change product options during checkout
Post by: tduffey on July 06, 2016, 04:20:52 am
Hi Everyone,

First of all, I'm using KonaKart 5 community (I know...) with a completely customized KonaKart frontend (client). We have a few products that now have options and would like customers to be able to change those options at checkout. In our flow this happens after the checkout order has already been created, and although I can update the basket items (By removing the existing item and adding a new one w/selected option since BasketMgr.updateBasket() only allows changing the quantity) the Order Product entries in the checkout order do not get updated.

I worked around this by simply setting the "opts" field of the associated OrderProduct, e.g.,

            for (OrderProductIf orderProduct : checkoutOrder.getOrderProducts()) {
                if (orderProduct.getProductId() == item.getProductId()) {
                    orderProduct.setOpts(item.getOpts());
                }
            }


This seems to work, but I'm wondering if anyone knows if there are undesirable side effects? For what it's worth, our current set of product options do not impact pricing or any other attribute of the order besides getting the option in there.

Tom
Title: Re: Change product options during checkout
Post by: julie on July 07, 2016, 04:36:01 pm
One thing you should check for is that the product with the changed options is in stock.