Develop Shipping Plugins

EShop supports multiple shipping plugins. After being installed, the shipping plugins are stored in the folder components/com_eshop/plugins/shipping.

Following are steps to create a shipping plugin for EShop:

Step 1: Create a .xml file to define the plugin package (example eshop_flat.xml) with the structure as following:

Step 2: Create a .php file to put the code to get the quote for the shipping (example eshop_flat.php):


// Each shipping plugin is defined as a class which is extended from parent class eshop_shipping
class eshop_flat extends eshop_shipping
{
    /**
     * 
     * Constructor function
     */
    function eshop_flat()
    {
        // Put the code here
    }

    /**
     * 
     * Function tet get quote for flat shipping
     * @param array $addressData
     * @param object $params
     */
    function getQuote($addressData, $params)
    {
        // Put the code here
    }
}

Step 3: Make a zip package include 2 above files, then login to the back-end of your site, go to EShop -> Plugins -> Shipping to choose the zip package of shipping plugin and install it from there.

To develop your own shipping plugin easily, you should based on the source code of the default shipping plugins in EShop.