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

dotcms & konakart - onepagecheckout

Started by innes, March 07, 2011, 01:11:19 pm

Previous topic - Next topic

innes

Hi

I am looking at the dotcms plugin & want to extend the checkout to support the payment providers in my KK Admin (especially PayPal). Can you provide the recommended steps to do this?

Should I use the downloaded plugin (it looks like there is source code & Ant script* provided) as a starting point and then extend it to support the additional KK functionality I require?

How do I add my additional code to the dotCMS installation?  Do I run the dotCMS Ant script to refresh the plugins?

Is there an tutorial that explains how to customise the plugin?  This would be really useful as the plugin is a good example of how a KK & dotCMS could interact but to get it into production we will need to customise it.  This would also be required if we are to benefit from new KK functionality in the future

Thanks,
Innes

ps Ant script consist of:

<project name="KonaKart plugin" default="build">   
   <import file="../common.xml"/>   
</project>

but common.xml isn't in zip file?

julie

In order to develop on top of the plugin you need to be able to run dotCMS in a development environment. You can find instructions of how to do this on the dotCMS web site.

If you are familiar with the standard KK store-front application you should be able to find your way around the KK code which you'll find under src\com\dotmarketing\plugins\konakart\* . Here's a snippet from the notes we supply in the plugin:

Description of KonaKart Plugin
==============================

The standard KonaKart store front application is a Struts / Tiles, JSP application where application code resides within Struts action classes and calls the KonaKart eCommerce engine in order to use the features of KonaKart.

The dotCMS plugin has a slightly different architecture. Under com.dotmarketing.plugins.konakart.actions you will see that there are a number of Struts action classes. These are used whenever an HTTP POST is performed. i.e. The submission of a form as in RegisterAction or CheckoutAction.

The code that is run in order to prepare data before displaying it, is contained within view tools under com.dotmarketing.plugins.konakart.viewtools. The most important of these view tools is called PrepareTool which substitutes a number of Struts action classes from the standard KonaKart store front application. The PrepareTool is called from pre-execute code of KonaKart widgets and is passed the action for that page so that the relevant data may be fetched from the database (by calling the KonaKart client and server engines) and stored in the session to be displayed by the dotCMS Velocity page.

The KonaKart view tools are defined in toolbox-ext.xml under the conf directory of the plugin. These view tools are called directly from the dotCMS Velocity pages.


Customizing the store front application
=======================================

dotCMS and the KonaKart plugin may be imported into a development environment such as Eclipse where the plugin code can be modified and debugged.

Payment Gateways
----------------

The plugin does not contain all of the standard KonaKart payment gateways. Authorize.net (AuthorizenetGateway.java) has been provided as an example. It is very similar to the Struts action class, AuthorizenetAction.java supplied in the standard KonaKart download.

In order to use a different payment gateway (let's say USA ePay), the procedure is as follows:

-Create a java class similar to AuthorizenetGateway.java, calling it UsaepayGateway.java using code copied from the struts action class UsaepayAction.java from the standard download.

-Edit CheckoutAction.java to instantiate and call UsaepayGateway.java instead of AuthorizenetGateway.java.

-Using the Admin Application, install USA ePay.

innes

Great, thanks.  I'll have a look.

Innes