function install()
 {
     if (Hook::get('orderPriceAdjustment') == false) {
         $hook = new Hook();
         $hook->name = 'orderPriceAdjustment';
         $hook->title = 'Order price adjustment';
         $hook->description = 'Allows modules to adjust prices in an order after the user has logged in and registered an address, e.g. allows prices based on group memberships and the like.';
         $hook->add();
     }
     if (parent::install() == false) {
         return false;
     }
     return true;
 }
Beispiel #2
0
 function install()
 {
     if (Hook::get('orderAddressVerification') == false) {
         $hook = new Hook();
         $hook->name = 'orderAddressVerification';
         $hook->title = 'Order address verificatio';
         $hook->description = 'Allows modules to verify delivery and billing address in an order, e.g. require them to be in the same country';
         $hook->add();
     }
     if (parent::install() == false) {
         return false;
     }
     return true;
 }
Beispiel #3
0
 function install()
 {
     if (!file_exists(dirname(__FILE__) . '/install.sql')) {
         return false;
     } else {
         if (!($sql = file_get_contents(dirname(__FILE__) . '/install.sql'))) {
             return false;
         }
     }
     $sql = str_replace('PREFIX_', _DB_PREFIX_, $sql);
     $sql = preg_split("/;\\s*[\r\n]+/", $sql);
     foreach ($sql as $query) {
         if (trim($query)) {
             Db::getInstance()->Execute(trim($query));
         }
     }
     $sql = "ALTER TABLE `PREFIX_cart_product` ADD COLUMN (`id_vendor` int(10) unsigned NOT NULL, FOREIGN KEY (`id_vendor`) REFERENCES `PREFIX_vendor`(`id_vendor`))";
     $sql = str_replace('PREFIX_', _DB_PREFIX_, $sql);
     try {
         Db::getInstance()->Execute(trim($sql));
     } catch (Exception $e) {
     }
     $sql = "DELETE FROM `PREFIX_postcode`";
     $sql = str_replace('PREFIX_', _DB_PREFIX_, $sql);
     Db::getInstance()->Execute(trim($sql));
     foreach (glob(dirname(__FILE__) . '/postcode_coordinates.*.csv') as $filename) {
         $parts = explode('.', $filename);
         $iso_code = $parts[count($parts) - 2];
         $query = 'select `id_country` from PREFIX_country where iso_code = "' . pSql($iso_code) . '"';
         $query = str_replace('PREFIX_', _DB_PREFIX_, $query);
         $result = Db::getInstance()->GetRow($query);
         $id_country = $result['id_country'];
         $file = fopen($filename, "r");
         $header = fgetcsv($file, 0, "\t");
         while ($line = fgetcsv($file, 0, "\t")) {
             echo "TRALALA<br>";
             $line = array_combine($header, $line);
             $query = 'INSERT INTO `PREFIX_postcode` (`id_country`, `name`, `longitude`, `latitude`) VALUES (' . pSql($id_country) . ', ' . '"' . pSql($line['Postcode']) . '", "' . pSql($line['Longitude']) . '", "' . pSql($line['Latitude']) . '")';
             $query = str_replace('PREFIX_', _DB_PREFIX_, $query);
             Db::getInstance()->Execute($query);
         }
     }
     if (parent::install() == false) {
         return false;
     }
     return true;
 }
Beispiel #4
0
 function install()
 {
     if (Hook::get('extraCarrierDetails') == false) {
         $hook = new Hook();
         $hook->name = 'extraCarrierDetails';
         $hook->title = 'Extra carrier dietails';
         $hook->description = 'Extra carrier dietails display part';
         $hook->add();
     }
     if (Hook::get('extraCarrierDetailsProcess') == false) {
         $hook = new Hook();
         $hook->name = 'extraCarrierDetailsProcess';
         $hook->title = 'Extra carrier dietails';
         $hook->description = 'Extra carrier dietails processing part';
         $hook->add();
     }
     return parent::install();
 }