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

Stale products/ attributes behavior

Started by hasalem, November 08, 2008, 11:08:46 pm

Previous topic - Next topic

hasalem

Hi All,

I'm asking about the behavior of konakart with stale products or options.

for example, if I have a Camera with the following attributes 2M/4M/8M memory.

and if a customer has an order or his/her current shopping basket has this product with this attribute "Camera with 2M"

now let's assume the camera with 2 M is obsolete, and the store owner has removed this attibute or option from the camera product.

so the camera now has option only 4/8 M memory.

Now if the customer tries to logon after this option has been removed, then he/she will not be able to see the shopping basket, because a Null Pointer exception is generated. This also applies if he wants to repeat an order with stale produce/option.

I thing there should be some service to recover the customer baskets from the stale products/options.

Any suggestion to solve the root cause of this problem, because I found that what I can do is catch this problem through the different actions. while I think it should be solved on the Engine level.





Best Regards
Hatem Salem

hasalem

Hi All,
I found the problem come from Konakart engine, the method of createOrderWithOptions.

This method throws NullPointerException if it can't find the options.

I think this bug is Ship Stopper, Because the KK users will be blocked if their shopping basket has any stale product/options.

Any suggestion to fix this problem ?!

Best Regards
Hatem Salem

julie

One thing you could do is to set the quantity to 0 rather than deleting the options.
Another thing you could do is to use the custom Admin Eng to customize the API call that deletes the options to delete all basket items containing the option.

hasalem

Thanks Julie for your reply.

QuoteOne thing you could do is to set the quantity to 0 rather than deleting the options.

How this will solve the problem? the option will be exposed for the user, and he can order it. Even if I changed the site to disable checkout of out of stock items. this will not solve the problem for current saved baskets. or reorder feature.

QuoteAnother thing you could do is to use the custom Admin Eng to customize the API call that deletes the options to delete all basket items containing the option.


I think this may solve the issue of the saved shopping basket, I will try to implement it. But this solution will not solve the issue of "repeat order". repeat order will create the temp order and add to the shopping basket. and I will face the same problem?!

Best Regards
Hatem salem

ryan

QuoteHow this will solve the problem?

The quantity is checked in CheckoutDeliveryAction when the customer attempts to checkout.

hasalem

Hi Ryan,

As I stated in my first post in this thread, this problem affects many actions.

The main problem now in the ShowCartItemsAction.
createTempOrder(kkAppEng, custId, items, ecf); throws NullPointerException because of

kkAppEng.getEng().createOrderWithOptions(sessionId, items, options,
                    kkAppEng.getLangId());


which suppress this exception.

then the same action throws the same exception at
                            for (int j = 0; j < b.getOpts().length; j++)
                            {
                                optNameArray[j] = b.getOpts()[j].getName() + " "
                                        + b.getOpts()[j].getValue();
                            }
                            item.setOptNameArray(optNameArray);

because b.getOpts()[j] returns null.

I've added these lines as a work around


                            for (int j = 0; j < b.getOpts().length; j++)
                            {
                            if(b.getOpts()[j]==null)
                            {
                            kkAppEng.getBasketMgr().removeFromBasket(b, /* refresh */true);
                            continue loop;
                            }
                                optNameArray[j] = b.getOpts()[j].getName() + " "
                                        + b.getOpts()[j].getValue();
                            }



This fixed the problem of  ShowCartItemsAction, while the problem is deeper in RepeatOrderAction, because it uses the engine repeat order method which throws null pointer exception.

I think we can make a dirty work around in the RepeatOrderAction, to handle this repeat manually, instead of using the Engine itself.
Do you think this is applied, or should I find another path?!

Best Regards
Hatem Salem