Validation of Order Totals

KonaKart supports tax and shipping modules that interface to external services in order to gather the requested data. These services may not always be available or may not return relevant data because of erroneous input data such as a non existent address.

One way of circumventing the problem for shipping modules is to provide a backup table driven module that only returns a quote if the primary module is unable to. This method always guarantees a shipping quote, allowing your customer to complete the transaction and to checkout. The table driven module may not return a 100% accurate shipping cost, but many merchants are happy to take a small risk on shipping charges rather than to risk an abandoned cart.

An alternative approach is to not allow your customer to checkout if all of the required order total modules do not exist. KonaKart includes code that allows you validate the order total modules using your own business rules. The code is in the KKAppEngCallouts class in a method called public boolean validateOrderTotals(KKAppEng eng, OrderIf order) . This class may be found under the custom\appn\src\com\konakart\al directory. The method provides sample code that determines whether certain modules are active and if so, checks to see whether an order total exists on the order for the active module. If it doesn't exist, the result is passed back to the customer in the form of a popup panel in the order confirmation screen, informing him that he cannot checkout because a problem has been encountered.