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

Potential Bug with Product Status Updates?

Started by chloeloves, September 29, 2010, 06:25:03 pm

Previous topic - Next topic

chloeloves

Hello,

I am having an issue that I just can't seem to resolve.

In my store, I do not want to have the concept of sold out items.  I just want to display them and mark them as sold out.  I also have set the can order when not in stock value to false on most of my products.

Most of my products have product options, and I have been configuring the products with a quantity of 0 at the product level, and a quantity of greater than 0 at the sku level.

For some reason, no matter what the case, a product is transitioned to the out of stock state by konakart.  I'm not sure where this is being done in your engine, but it is being done.

I even went as far as overiding the reorder method in the reorder mgr to always set the status to in stock, but still some way or another a product will move to the out of stock state.

Is there a know issue of some sort?  When i configure the quanities at the product option level, do i have to have values for SKU and availablilty date?  Is there something else you can think of ?


public void reorder(int productId, String sku, int currentQuantity) throws Exception
    {
        log.info("Reorder required for product id = " + productId + " and sku = " + sku
                + " . The remaining quantity is " + currentQuantity);
       
        ProductIf theProduct = getEng().getProduct(null, productId, 1);
       
        if(theProduct != null && theProduct.getCanOrderWhenNotInStock() == false) {
        CLCEngine clcEngine = (CLCEngine) ApplicationContext.getContext().getBean(CLCEngine.CONTEXT_NAME);
        // just always keep the items in stock, we have other logic that will display
        // it as out of stock on the site.
        clcEngine.getProductManager().updateProductStatus(productId, ProductManager.IN_STOCK);
       
       
       
        }
    }

julie

In order to keep on displaying the products you need to set "can order when not in stock" = true, otherwise they are disabled when the stock level falls to zero and no longer displayed.  The getProductQuantity() API call will give you the quantity and so you can add your own business logic depending on how you want to handle the situation when someone attempts to order a product that isn't in stock. UpdateBasketWIthStockInfo() also populates the array of basket items with stock information if you need to handle it during the checkout process.

chloeloves

Thanks for the reply.

I'm not sure I made this clear in the first post, but in my situation the stock level never falls to zero.  Thats whats puzzling to me.  I log into the admin tool and i see a bunch of products that are marked as out of stock, but each of them have a sku quantity level greater than 0. 

I think I found a hack tho, because it hasn't been doing in in a while.  I set the global reorder level to a really high number (1000), and in my reorder integration manager I always set the product status = in stock no matter what.  So far, I haven't seen any of my products mysteriously transition to out of stock.