Making something happen when a product needs to be reordered

When the number of products in stock hits the reorder level defined by the configuration property STOCK_REORDER_LEVEL, KonaKart instantiates a class defined by the property STOCK_REORDER_CLASS. If this property isn't set, the class that is instantiated is com.konakart.bl.ReorderMgr. If you write a custom class it must implement the interface com.konakart.bl.ReorderMgrInterface which contains only one method:


public void reorder(int productId, String sku, int currentQuantity) throws Exception;

After the class is instantiated, the reorder method is called and information regarding the productId, the SKU and current product quantity is passed to the method so that it can use this information to trigger an event. This mechanism is a useful generic way to interface KonaKart to external systems since the custom class could write data to a database, call a web service or write data to a file etc.

If the configuration variable STOCK_REORDER_EMAIL is set, then KonaKart will also send an eMail alert using the LowStockAlert template.

All of the configuration variables can be edited in the Configuration>>Stock and Orders section of the Admin App.