Exemplo n.º 1
0
        }
        //If this is the first plugin, make it the default one
        if (count(ECommShipping::$activeShippingPlugin) == 1) {
            $isDefault = true;
        }
        if ($isDefault) {
            //If a plugin is the default shipping class:
            //First, set the defaultPlugin variable to the name of this class
            //Second, change the order of the array becuase the default plugin MUST always be the first shipping plugin
            ECommShipping::$defaultPlugin = $className;
            $tempArray = ECommShipping::$activeShippingPlugin;
            ECommShipping::$activeShippingPlugin = array();
            ECommShipping::$activeShippingPlugin[$className] = $tempArray[$className];
            //Put the default plugin at the beginning
            foreach ($tempArray as $key => $val) {
                ECommShipping::$activeShippingPlugin[$key] = $val;
            }
        }
    }
    //Override the following function to administer the shipping price
    //The $ECommModule variable represents the module object in case you need to use ->addCSS or ->smarty
    public function getAdminInterface($ECommModule)
    {
        return "This plugin does not have any admin interface";
    }
}
ECommShipping::init("CanadaPost", false);
ECommShipping::init("FedEx", false);
ECommShipping::init("NewMethod", false);
ECommShipping::init("EAndA");