示例#1
0
 public function deinstall()
 {
     Sumo\Database::query("DROP TABLE IF EXISTS PREFIX_app_sisow");
     Sumo\Database::query("DROP TABLE IF EXISTS PREFIX_app_sisow_payments");
     Sumo\Database::query("DROP TABLE IF EXISTS PREFIX_app_sisow_payments_info");
     return true;
 }
示例#2
0
 public function setAppStatus($store_id, $active = 0)
 {
     try {
         $list = array();
         $list['app'] = $this->getAppId();
         $list['store'] = $store_id;
         Sumo\Database::query("DELETE FROM PREFIX_apps_active WHERE app_id = :app AND store_id = :store", $list);
         $list['active'] = $active;
         Sumo\Database::query("INSERT INTO PREFIX_apps_active SET app_id = :app, store_id = :store, active = :active", $list);
     } catch (\Exception $e) {
         Sumo\Logger::error('Changing app status failed: ' . print_r($e, true));
     }
 }
示例#3
0
 public function deinstall()
 {
     // Remove the settings table
     Sumo\Database::query("DROP TABLE IF EXISTS PREFIX_app_paymentpickup");
     // Remove translation values
     Sumo\Database::query("DELETE FROM PREFIX_tanslations WHERE key_id = :id", array('id' => Sumo\Database::query("SELECT id FROM PREFIX_translations_keys WHERE name = 'APP_PAYMENTPICKUP_TITLE'")->fetchColumn()));
     Sumo\Database::query("DELETE FROM PREFIX_tanslations WHERE key_id = :id", array('id' => Sumo\Database::query("SELECT id FROM PREFIX_translations_keys WHERE name = 'APP_PAYMENTPICKUP_ENABLE'")->fetchColumn()));
     Sumo\Database::query("DELETE FROM PREFIX_tanslations WHERE key_id = :id", array('id' => Sumo\Database::query("SELECT id FROM PREFIX_translations_keys WHERE name = 'APP_PAYMENTPICKUP_PAYMENT_STATUS'")->fetchColumn()));
     // Finally, remove translation keys
     Sumo\Database::query("DELETE FROM PREFIX_translations_keys WHERE name = 'APP_PAYMENTPICKUP_TITLE'");
     Sumo\Database::query("DELETE FROM PREFIX_translations_keys WHERE name = 'APP_PAYMENTPICKUP_ENABLE'");
     Sumo\Database::query("DELETE FROM PREFIX_translations_keys WHERE name = 'APP_PAYMENTPICKUP_PAYMENT_STATUS'");
     return true;
 }
示例#4
0
 public function deinstall()
 {
     Sumo\Database::query("DROP TABLE IF EXISTS PREFIX_app_shippingweight");
     return true;
 }
示例#5
0
define('DIR_CATALOG', DIR_HOME . 'catalog/');
define('DIR_APPLICATION', DIR_HOME . 'admin/');
define('DIR_TEMPLATE', DIR_APPLICATION . 'view/template/');
require_once DIR_SYSTEM . 'library/user.php';
$settings = Sumo\Database::fetchAll("SELECT setting_name, setting_value, is_json FROM PREFIX_settings");
foreach ($settings as $list) {
    if ($list['is_json']) {
        $list['setting_value'] = json_decode($list['setting_value'], true);
    }
    $config->set($list['setting_name'], $list['setting_value']);
    // Legacy
    $config->set('config_' . $list['setting_name'], $list['setting_value']);
}
$title = Sumo\Database::query("SELECT name FROM PREFIX_stores LIMIT 1")->fetch();
$config->set('name', $title['name']);
$store = Sumo\Database::query("SELECT * FROM PREFIX_stores WHERE store_id = 0 LIMIT 1")->fetch();
if ($store['base_default'] == 'https') {
    $store['base_https'] = 'https://' . $store['base_https'];
    // Check for http vs https if https is enabled
    if (!isset($_SERVER['HTTPS']) || (!$_SERVER['HTTPS'] || strtolower($_SERVER['HTTPS']) == 'off')) {
        // Check if URL is SSL-enabled or not
        header('HTTP/1.1 301 Moved Permanently');
        header('Location: ' . $store['base_https'] . trim($_SERVER['REQUEST_URI'], '/') . '/');
        exit;
    }
} else {
    $store['base_https'] = 'http://' . $store['base_http'];
}
$config->set('base_default', $store['base_default']);
$config->set('base_http', $store['base_https']);
$config->set('base_https', $store['base_https']);
示例#6
0
 public function deinstall()
 {
     Sumo\Database::query("DROP TABLE IF EXISTS PREFIX_app_widgetsimplefooter");
     return true;
 }
示例#7
0
 public function deinstall()
 {
     Sumo\Database::query("DROP TABLE IF EXISTS PREFIX_app_banktransfer");
     return true;
 }
示例#8
0
 public function deinstall()
 {
     Sumo\Database::query("DROP TABLE IF EXISTS PREFIX_app_cashondelivery");
     return true;
 }
示例#9
0
 public function getFilters($data)
 {
     if (empty($data['data']['filter_category_id'])) {
         return;
     }
     if (!empty($data['data']['filter_category_id'])) {
         $category_id = $data['data']['filter_category_id'];
     }
     if (empty($data['data']['start'])) {
         $data['data']['start'] = 0;
     }
     if (empty($data['data']['limit'])) {
         $data['data']['limit'] = 15;
     }
     if (empty($data['data']['sort'])) {
         $data['data']['sort'] = 'p.sort_order';
     }
     if (empty($data['data']['order']) || !in_array($data['data']['order'], array('ASC', 'DESC'))) {
         $data['data']['order'] = 'ASC';
     }
     $cache = 'wsp_filters_' . md5(json_encode($data));
     $result = Sumo\Cache::find($cache);
     if (is_array($result) && !empty($result)) {
         return $result;
     }
     $filters = Sumo\Database::fetchAll("SELECT a.attribute_group_id\n            FROM PREFIX_product_attribute AS pa\n            LEFT JOIN PREFIX_attribute AS a\n                ON a.attribute_id = pa.attribute_id\n            LEFT JOIN PREFIX_product_to_category AS ptc\n                ON ptc.product_id = pa.product_id\n            WHERE ptc.category_id = :cat\n                AND pa.language_id = :lang\n                ", array('cat' => $category_id, 'lang' => $this->config->get('language_id')));
     $result = array();
     foreach ($filters as $filter) {
         if (!isset($result[$filter['attribute_group_id']])) {
             $group = Sumo\Database::query("SELECT name FROM PREFIX_attribute_group_description WHERE attribute_group_id = :group AND language_id = :lang", array('group' => $filter['attribute_group_id'], 'lang' => $this->config->get('language_id')))->fetch();
             $result[$filter['attribute_group_id']]['name'] = $group['name'];
             $attributes = Sumo\Database::fetchAll("SELECT a.attribute_id, ad.name\n                    FROM PREFIX_attribute AS a\n                    LEFT JOIN PREFIX_attribute_description AS ad\n                        ON a.attribute_id = ad.attribute_id\n                    WHERE a.attribute_group_id  = :group\n                        AND ad.language_id      = :lang", array('group' => $filter['attribute_group_id'], 'lang' => $this->config->get('language_id')));
             foreach ($attributes as $list) {
                 if (isset($data['data']['filter_filter'][$list['attribute_id']])) {
                     $list['active'] = true;
                 }
                 $result[$filter['attribute_group_id']]['filters'][$list['attribute_id']] = $list;
             }
         }
     }
     Sumo\Cache::set($cache, $result);
     return $result;
 }