Ejemplo n.º 1
0
 public static function updateDB()
 {
     global $lC_Database;
     $pf = defined('DB_TABLE_PREFIX') ? DB_TABLE_PREFIX : 'lc_';
     $engine = defined('DB_DATABASE_CLASS') && DB_DATABASE_CLASS == 'mysqli_innodb' ? 'InnoDB' : 'MyISAM';
     $lC_Database->simpleQuery("ALTER IGNORE TABLE `" . $pf . "banners` ADD `banners_target` INT( 1 ) NOT NULL DEFAULT '1' AFTER `banners_url`;");
     parent::log("Database Update: ALTER IGNORE TABLE `" . $pf . "banners` ADD `banners_target` INT( 1 ) NOT NULL DEFAULT '1' AFTER `banners_url`;");
     $lC_Database->simpleQuery("ALTER IGNORE TABLE `" . $pf . "products` ADD `products_cost` DECIMAL( 15, 4 ) NOT NULL DEFAULT '0' AFTER `products_quantity`;");
     parent::log("Database Update: ALTER IGNORE TABLE `" . $pf . "products` ADD `products_cost` DECIMAL( 15, 4 ) NOT NULL DEFAULT '0' AFTER `products_quantity`;");
     $lC_Database->simpleQuery("ALTER IGNORE TABLE `" . $pf . "products` ADD `products_msrp` DECIMAL( 15, 4 ) NOT NULL DEFAULT '0' AFTER `products_price`;");
     parent::log("Database Update: ALTER IGNORE TABLE `" . $pf . "products` ADD `products_msrp` DECIMAL( 15, 4 ) NOT NULL DEFAULT '0' AFTER `products_price`;");
     $lC_Database->simpleQuery("ALTER IGNORE TABLE `" . $pf . "products` ADD `products_sku` VARCHAR( 255 ) NOT NULL AFTER `products_model`;");
     parent::log("Database Update: ALTER IGNORE TABLE `" . $pf . "products` ADD `products_sku` VARCHAR( 255 ) NOT NULL AFTER `products_model`;");
     $lC_Database->simpleQuery("ALTER IGNORE TABLE `" . $pf . "products_simple_options_values` ADD `products_id` INT( 11 ) NOT NULL AFTER `id`;");
     parent::log("Database Update: ALTER IGNORE TABLE `" . $pf . "products_simple_options_values` ADD `products_id` INT( 11 ) NOT NULL AFTER `id`;");
     $lC_Database->simpleQuery("ALTER IGNORE TABLE `" . $pf . "products_simple_options_values` ADD `sort_order` INT( 11 ) NOT NULL DEFAULT '0' AFTER `price_modifier`;");
     parent::log("Database Update: ALTER IGNORE TABLE `" . $pf . "products_simple_options_values` ADD `sort_order` INT( 11 ) NOT NULL DEFAULT '0' AFTER `price_modifier`;");
     $lC_Database->simpleQuery("ALTER IGNORE TABLE `" . $pf . "orders_products` ADD `products_simple_options_meta_data` VARCHAR( 1024 ) NOT NULL AFTER `products_quantity`;");
     parent::log("Database Update: ALTER IGNORE TABLE `" . $pf . "orders_products` ADD `products_simple_options_meta_data` VARCHAR( 1024 ) NOT NULL AFTER `products_quantity`;");
     $lC_Database->simpleQuery("ALTER IGNORE TABLE `" . $pf . "shopping_carts` ADD `meta_data` VARCHAR( 1024 ) NOT NULL AFTER `quantity`;");
     parent::log("Database Update: ALTER IGNORE TABLE `" . $pf . "shopping_carts` ADD `meta_data` VARCHAR( 1024 ) NOT NULL AFTER `quantity`;");
     $lC_Database->simpleQuery("ALTER IGNORE TABLE `" . $pf . "categories` ADD `categories_mode` VARCHAR( 128 ) DEFAULT NULL AFTER `sort_order`;");
     parent::log("Database Update: ALTER IGNORE TABLE `" . $pf . "categories` ADD `categories_mode` VARCHAR( 128 ) DEFAULT NULL AFTER `sort_order`;");
     $lC_Database->simpleQuery("ALTER IGNORE TABLE `" . $pf . "categories` ADD `categories_link_target` TINYINT( 1 ) DEFAULT '0' AFTER `categories_mode`;");
     parent::log("Database Update: ALTER IGNORE TABLE `" . $pf . "categories` ADD `categories_link_target` TINYINT( 1 ) DEFAULT '0' AFTER `categories_mode`;");
     $lC_Database->simpleQuery("ALTER IGNORE TABLE `" . $pf . "categories` ADD `categories_custom_url` VARCHAR( 255 ) DEFAULT NULL AFTER `categories_link_target`;");
     parent::log("Database Update: ALTER IGNORE TABLE `" . $pf . "categories` ADD `categories_custom_url` VARCHAR( 255 ) DEFAULT NULL AFTER `categories_link_target`;");
     $lC_Database->simpleQuery("ALTER IGNORE TABLE `" . $pf . "categories` ADD `categories_status` TINYINT( 1 ) DEFAULT NULL AFTER `categories_show_in_listings`;");
     parent::log("Database Update: ALTER IGNORE TABLE `" . $pf . "categories` ADD `categories_status` TINYINT( 1 ) DEFAULT NULL AFTER `categories_show_in_listings`;");
     $lC_Database->simpleQuery("ALTER IGNORE TABLE `" . $pf . "categories` ADD `categories_visibility_nav` TINYINT( 1 ) DEFAULT '0' AFTER `categories_status`;");
     parent::log("Database Update: ALTER IGNORE TABLE `" . $pf . "categories` ADD `categories_visibility_nav` TINYINT( 1 ) DEFAULT '0' AFTER `categories_status`;");
     $lC_Database->simpleQuery("ALTER IGNORE TABLE `" . $pf . "categories` ADD `categories_visibility_box` TINYINT( 1 ) DEFAULT '1' AFTER `categories_visibility_nav`;");
     parent::log("Database Update: ALTER IGNORE TABLE `" . $pf . "categories` ADD `categories_visibility_box` TINYINT( 1 ) DEFAULT '1' AFTER `categories_visibility_nav`;");
     $lC_Database->simpleQuery("ALTER IGNORE TABLE `" . $pf . "categories_description` ADD `categories_menu_name` VARCHAR( 255 ) DEFAULT NULL AFTER `categories_name`;");
     parent::log("Database Update: ALTER IGNORE TABLE `" . $pf . "categories_description` ADD `categories_menu_name` VARCHAR( 255 ) DEFAULT NULL AFTER `categories_name`;");
     $lC_Database->simpleQuery("ALTER IGNORE TABLE `" . $pf . "categories_description` ADD `categories_blurb ` VARCHAR( 1024 ) DEFAULT NULL AFTER `categories_menu_name`;");
     parent::log("Database Update: ALTER IGNORE TABLE `" . $pf . "categories_description` ADD `categories_blurb ` VARCHAR( 1024 ) DEFAULT NULL AFTER `categories_menu_name`;");
     $lC_Database->simpleQuery("ALTER IGNORE TABLE `" . $pf . "categories_description` ADD `categories_description` TEXT AFTER `categories_blurb`;");
     parent::log("Database Update: ALTER IGNORE TABLE `" . $pf . "categories_description` ADD `categories_description` TEXT AFTER `categories_blurb`;");
     $lC_Database->simpleQuery("ALTER IGNORE TABLE `" . $pf . "categories_description` ADD `categories_keyword` VARCHAR( 255 ) DEFAULT NULL AFTER `categories_description`;");
     parent::log("Database Update: ALTER IGNORE TABLE `" . $pf . "categories_description` ADD `categories_keyword` VARCHAR( 255 ) DEFAULT NULL AFTER `categories_description`;");
     $lC_Database->simpleQuery("ALTER IGNORE TABLE `" . $pf . "categories_description` ADD `categories_tags` VARCHAR( 255 ) DEFAULT NULL AFTER `categories_keyword`;");
     parent::log("Database Update:  ALTER IGNORE TABLE `" . $pf . "categories_description` ADD `categories_tags` VARCHAR( 255 ) DEFAULT NULL AFTER `categories_keyword`;");
     $lC_Database->simpleQuery("UPDATE IGNORE `" . $pf . "configuration_group` SET `configuration_group_title` = 'Checkout', `configuration_group_description` = 'Checkout settings' where `configuration_group_id` = '19';");
     parent::log("Database Update: UPDATE IGNORE `" . $pf . "configuration_group` SET `configuration_group_title` = 'Checkout', `configuration_group_description` = 'Checkout settings' where `configuration_group_id` = '19';");
     if (!defined('CHECKOUT_SUPPRESS_NON_MOBILE_PAYMENT_MODULES')) {
         $lC_Database->simpleQuery("INSERT INTO `" . $pf . "configuration` (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES('Suppress Non-Mobile Payment Modules', 'CHECKOUT_SUPPRESS_NON_MOBILE_PAYMENT_MODULES', '-1', 'Suppress non-mobile payment modules in catalog when being viewed in mobile format.', 19, 0, NULL, '2012-10-09 18:17:08', 'lc_cfg_use_get_boolean_value', 'lc_cfg_set_boolean_value(array(1, -1))');");
         parent::log("Database Update: INSERT INTO `" . $pf . "configuration` (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES('Suppress Non-Mobile Payment Modules', 'CHECKOUT_SUPPRESS_NON_MOBILE_PAYMENT_MODULES', '-1', 'Suppress non-mobile payment modules in catalog when being viewed in mobile format.', 19, 0, NULL, '2012-10-09 18:17:08', 'lc_cfg_use_get_boolean_value', 'lc_cfg_set_boolean_value(array(1, -1))');");
     }
     $lC_Database->simpleQuery("ALTER IGNORE TABLE `" . $pf . "customers` CHANGE `customers_password` `customers_password` VARCHAR( 128 ) CHARACTER SET utf8 COLLATE utf8_general_ci NULL;");
     parent::log("Database Update: ALTER IGNORE TABLE `" . $pf . "customers` CHANGE `customers_password` `customers_password` VARCHAR( 128 ) CHARACTER SET utf8 COLLATE utf8_general_ci NULL;");
     $lC_Database->simpleQuery("ALTER IGNORE TABLE `" . $pf . "administrators` CHANGE `user_password` `user_password` VARCHAR( 128 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL;");
     parent::log("Database Update: ALTER IGNORE TABLE `" . $pf . "administrators` CHANGE `user_password` `user_password` VARCHAR( 128 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL;");
     $lC_Database->simpleQuery("ALTER IGNORE TABLE `" . $pf . "administrators` ADD `verify_key` VARCHAR( 64 ) DEFAULT NULL AFTER `access_group_id`;");
     parent::log("Database Update: ALTER IGNORE TABLE `" . $pf . "administrators` ADD `verify_key` VARCHAR( 64 ) DEFAULT NULL AFTER `access_group_id`;");
     $lC_Database->simpleQuery("ALTER IGNORE TABLE `" . $pf . "administrators` ADD `language_id` INT( 11 ) NOT NULL DEFAULT '1'  AFTER `verify_key`;");
     parent::log("Database Update: ALTER IGNORE TABLE `" . $pf . "administrators` ADD `language_id` INT( 11 ) NOT NULL DEFAULT '1' AFTER `verify_key`;");
     $lC_Database->simpleQuery("CREATE TABLE IF NOT EXISTS `" . $pf . "coupons` (coupons_id int(11) NOT NULL AUTO_INCREMENT, `type` enum('R','T','S','P') NOT NULL DEFAULT 'R', mode varchar(32) NOT NULL DEFAULT 'coupon', code varchar(32) NOT NULL, reward decimal(8,4) NOT NULL DEFAULT '0.0000', purchase_over decimal(8,4) NOT NULL DEFAULT '0.0000', start_date datetime DEFAULT NULL, expires_date datetime DEFAULT NULL, uses_per_coupon int(11) NOT NULL DEFAULT '0', uses_per_customer int(11) NOT NULL DEFAULT '0', restrict_to_products varchar(1024) DEFAULT NULL, restrict_to_categories varchar(1024) DEFAULT NULL, restrict_to_customers varchar(1024) DEFAULT NULL, `status` tinyint(1) NOT NULL DEFAULT '1', date_created datetime NOT NULL DEFAULT '0000-00-00 00:00:00', date_modified datetime NOT NULL DEFAULT '0000-00-00 00:00:00', sale_exclude tinyint(1) NOT NULL DEFAULT '0', notes varchar(255) NOT NULL, PRIMARY KEY (coupons_id)) ENGINE=" . $engine . " CHARACTER SET utf8 COLLATE utf8_general_ci;");
     parent::log("Database Update: CREATE TABLE IF NOT EXISTS `" . $pf . "coupons` (coupons_id int(11) NOT NULL AUTO_INCREMENT, `type` enum('R','T','S','P') NOT NULL DEFAULT 'R', mode varchar(32) NOT NULL DEFAULT 'coupon', code varchar(32) NOT NULL, reward decimal(8,4) NOT NULL DEFAULT '0.0000', purchase_over decimal(8,4) NOT NULL DEFAULT '0.0000', start_date datetime DEFAULT NULL, expires_date datetime DEFAULT NULL, uses_per_coupon int(11) NOT NULL DEFAULT '0', uses_per_customer int(11) NOT NULL DEFAULT '0', restrict_to_products varchar(1024) DEFAULT NULL, restrict_to_categories varchar(1024) DEFAULT NULL, restrict_to_customers varchar(1024) DEFAULT NULL, `status` tinyint(1) NOT NULL DEFAULT '1', date_created datetime NOT NULL DEFAULT '0000-00-00 00:00:00', date_modified datetime NOT NULL DEFAULT '0000-00-00 00:00:00', sale_exclude tinyint(1) NOT NULL DEFAULT '0', notes varchar(255) NOT NULL, PRIMARY KEY (coupons_id)) ENGINE=" . $engine . " CHARACTER SET utf8 COLLATE utf8_general_ci;");
     $lC_Database->simpleQuery("CREATE TABLE IF NOT EXISTS `" . $pf . "coupons_description` (coupons_id int(11) NOT NULL DEFAULT '0', language_id int(11) NOT NULL DEFAULT '1', name varchar(1024) NOT NULL DEFAULT '', PRIMARY KEY (coupons_id,language_id)) ENGINE=" . $engine . " CHARACTER SET utf8 COLLATE utf8_general_ci;");
     parent::log("Database Update: CREATE TABLE IF NOT EXISTS `" . $pf . "coupons_description` (coupons_id int(11) NOT NULL DEFAULT '0', language_id int(11) NOT NULL DEFAULT '1', name varchar(1024) NOT NULL DEFAULT '', PRIMARY KEY (coupons_id,language_id)) ENGINE=" . $engine . " CHARACTER SET utf8 COLLATE utf8_general_ci;");
     $lC_Database->simpleQuery("CREATE TABLE IF NOT EXISTS `" . $pf . "coupons_redeemed` ( id int(11) NOT NULL AUTO_INCREMENT, coupons_id int(11) NOT NULL DEFAULT '0', customers_id int(11) NOT NULL DEFAULT '0', redeem_date datetime NOT NULL DEFAULT '0000-00-00 00:00:00', redeem_ip varchar(32) NOT NULL DEFAULT '', order_id int(11) NOT NULL DEFAULT '0', PRIMARY KEY (id)) ENGINE=" . $engine . " CHARACTER SET utf8 COLLATE utf8_general_ci;");
     parent::log("Database Update: CREATE TABLE IF NOT EXISTS `" . $pf . "coupons_redeemed` ( id int(11) NOT NULL AUTO_INCREMENT, coupons_id int(11) NOT NULL DEFAULT '0', customers_id int(11) NOT NULL DEFAULT '0', redeem_date datetime NOT NULL DEFAULT '0000-00-00 00:00:00', redeem_ip varchar(32) NOT NULL DEFAULT '', order_id int(11) NOT NULL DEFAULT '0', PRIMARY KEY (id)) ENGINE=" . $engine . " CHARACTER SET utf8 COLLATE utf8_general_ci;");
     if (!defined('MODULE_ORDER_TOTAL_COUPON_STATUS')) {
         $lC_Database->simpleQuery("INSERT INTO `" . $pf . "configuration` (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES('Display Coupon', 'MODULE_ORDER_TOTAL_COUPON_STATUS', 'true', 'Do you want to dusplay the coupon discount total on the checkout pages?', 6, 0, NULL, '2013-07-30 14:10:55', 'lc_cfg_use_get_boolean_value', 'lc_cfg_set_boolean_value(array(''true'', ''false''))');");
         parent::log("Database Update: INSERT INTO `" . $pf . "configuration` (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES('Display Coupon', 'MODULE_ORDER_TOTAL_COUPON_STATUS', 'true', 'Do you want to dusplay the coupon discount total on the checkout pages?', 6, 0, NULL, '2013-07-30 14:10:55', 'lc_cfg_use_get_boolean_value', 'lc_cfg_set_boolean_value(array(''true'', ''false''))');");
     }
     if (!defined('MODULE_ORDER_TOTAL_COUPON_SORT_ORDER')) {
         $lC_Database->simpleQuery("INSERT INTO `" . $pf . "configuration` (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES('Sort Order', 'MODULE_ORDER_TOTAL_COUPON_SORT_ORDER', '300', 'Sort order of the display.', 6, 0, NULL, '2013-07-30 14:10:55', NULL, NULL);");
         parent::log("Database Update: INSERT INTO `" . $pf . "configuration` (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES('Sort Order', 'MODULE_ORDER_TOTAL_COUPON_SORT_ORDER', '300', 'Sort order of the display.', 6, 0, NULL, '2013-07-30 14:10:55', NULL, NULL);");
     }
     if (!defined('SERVICE_COUPONS_DISPLAY_ON_CART_PAGE')) {
         $lC_Database->simpleQuery("INSERT INTO `" . $pf . "configuration` (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES('Redeem On Cart Page?', 'SERVICE_COUPONS_DISPLAY_ON_CART_PAGE', '1', 'Display the coupons redemption form on the shopping cart page?', 6, 0, NULL, '2013-07-31 19:05:14', 'lc_cfg_use_get_boolean_value', 'lc_cfg_set_boolean_value(array(1, -1))');");
         parent::log("Database Update: INSERT INTO `" . $pf . "configuration` (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES('Redeem On Cart Page?', 'SERVICE_COUPONS_DISPLAY_ON_CART_PAGE', '1', 'Display the coupons redemption form on the shopping cart page?', 6, 0, NULL, '2013-07-31 19:05:14', 'lc_cfg_use_get_boolean_value', 'lc_cfg_set_boolean_value(array(1, -1))');");
     }
     if (!defined('SERVICE_COUPONS_DISPLAY_ON_SHIPPING_PAGE')) {
         $lC_Database->simpleQuery("INSERT INTO `" . $pf . "configuration` (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES('Redeem On Shipping Page?', 'SERVICE_COUPONS_DISPLAY_ON_SHIPPING_PAGE', '1', 'Display the coupons redemption form on the checkout shipping page?', 6, 0, NULL, '2013-07-31 19:05:14', 'lc_cfg_use_get_boolean_value', 'lc_cfg_set_boolean_value(array(1, -1))');");
         parent::log("Database Update: INSERT INTO `" . $pf . "configuration` (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES('Redeem On Shipping Page?', 'SERVICE_COUPONS_DISPLAY_ON_SHIPPING_PAGE', '1', 'Display the coupons redemption form on the checkout shipping page?', 6, 0, NULL, '2013-07-31 19:05:14', 'lc_cfg_use_get_boolean_value', 'lc_cfg_set_boolean_value(array(1, -1))');");
     }
     if (!defined('SERVICE_COUPONS_DISPLAY_ON_PAYMENT_PAGE')) {
         $lC_Database->simpleQuery("INSERT INTO `" . $pf . "configuration` (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES('Redeem On Payment Page?', 'SERVICE_COUPONS_DISPLAY_ON_PAYMENT_PAGE', '1', 'Display the coupons redemption form on the checkout payment page?', 6, 0, NULL, '2013-07-31 19:05:14', 'lc_cfg_use_get_boolean_value', 'lc_cfg_set_boolean_value(array(1, -1))');");
         parent::log("Database Update: INSERT INTO `" . $pf . "configuration` (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES('Redeem On Payment Page?', 'SERVICE_COUPONS_DISPLAY_ON_PAYMENT_PAGE', '1', 'Display the coupons redemption form on the checkout payment page?', 6, 0, NULL, '2013-07-31 19:05:14', 'lc_cfg_use_get_boolean_value', 'lc_cfg_set_boolean_value(array(1, -1))');");
     }
     if (!defined('SERVICE_COUPONS_DISPLAY_ON_CONFIRMATION_PAGE')) {
         $lC_Database->simpleQuery("INSERT INTO `" . $pf . "configuration` (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES('Redeem On Confirmation Page?', 'SERVICE_COUPONS_DISPLAY_ON_CONFIRMATION_PAGE', '1', 'Display the coupons redemption form on the checkout confirmation page?', 6, 0, NULL, '2013-07-31 19:05:14', 'lc_cfg_use_get_boolean_value', 'lc_cfg_set_boolean_value(array(1, -1))');");
         parent::log("Database Update: INSERT INTO `" . $pf . "configuration` (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES('Redeem On Confirmation Page?', 'SERVICE_COUPONS_DISPLAY_ON_CONFIRMATION_PAGE', '1', 'Display the coupons redemption form on the checkout confirmation page?', 6, 0, NULL, '2013-07-31 19:05:14', 'lc_cfg_use_get_boolean_value', 'lc_cfg_set_boolean_value(array(1, -1))');");
     }
     $lC_Database->simpleQuery("ALTER IGNORE TABLE `" . $pf . "orders_status` ADD `orders_status_type` ENUM( 'Pending', 'Rejected', 'Approved' ) NOT NULL DEFAULT 'Pending' AFTER `orders_status_name`;");
     parent::log("Database Update: ALTER IGNORE TABLE `" . $pf . "orders_status` ADD `orders_status_type` ENUM( 'Pending', 'Rejected', 'Approved' ) NOT NULL DEFAULT 'Pending' AFTER `orders_status_name`;");
     $lC_Database->simpleQuery("ALTER IGNORE TABLE `" . $pf . "orders_status_history` ADD `administrators_id` INT( 11 ) NOT NULL DEFAULT '0' AFTER `comments`;");
     parent::log("Database Update: ALTER IGNORE TABLE `" . $pf . "orders_status_history` ADD `administrators_id` INT( 11 ) NOT NULL DEFAULT '0' AFTER `comments`;");
     $lC_Database->simpleQuery("ALTER IGNORE TABLE `" . $pf . "orders_status_history` ADD `append_comment` INT( 11 ) NOT NULL DEFAULT '1' AFTER `administrators_id`;");
     parent::log("Database Update: ALTER IGNORE TABLE `" . $pf . "orders_status_history` ADD `append_comment` INT( 11 ) NOT NULL DEFAULT '1' AFTER `administrators_id`;");
     $lC_Database->simpleQuery("ALTER IGNORE TABLE `" . $pf . "products` ADD `is_subproduct` TINYINT( 1 ) NOT NULL DEFAULT '0' AFTER `has_children`;");
     parent::log("Database Update: ALTER IGNORE TABLE `" . $pf . "products` ADD `is_subproduct` TINYINT( 1 ) NOT NULL DEFAULT '0' AFTER `has_children`;");
     $lC_Database->simpleQuery("CREATE TABLE IF NOT EXISTS `" . $pf . "permalinks` (permalink_id int(11) NOT NULL AUTO_INCREMENT, item_id int(11) NOT NULL, language_id int(11) NOT NULL DEFAULT '1', `type` int(11) NOT NULL, query varchar(255) NOT NULL, permalink varchar(255) NOT NULL, PRIMARY KEY (permalink_id,permalink)) ENGINE=" . $engine . " CHARACTER SET utf8 COLLATE utf8_general_ci;");
     parent::log("Database Update: CREATE TABLE IF NOT EXISTS `" . $pf . "permalinks` (permalink_id int(11) NOT NULL AUTO_INCREMENT, item_id int(11) NOT NULL, language_id int(11) NOT NULL DEFAULT '1', `type` int(11) NOT NULL, query varchar(255) NOT NULL, permalink varchar(255) NOT NULL, PRIMARY KEY (permalink_id,permalink)) ENGINE=" . $engine . " CHARACTER SET utf8 COLLATE utf8_general_ci;");
     $lC_Database->simpleQuery("INSERT IGNORE INTO `" . $pf . "configuration_group` (configuration_group_id, configuration_group_title, configuration_group_description, sort_order, visible) VALUES (20, 'Editor', 'Editor settings', 20, 1);");
     parent::log("Database Update: INSERT IGNORE INTO `" . $pf . "configuration_group` (configuration_group_id, configuration_group_title, configuration_group_description, sort_order, visible) VALUES (20, 'Editor', 'Editor settings', 20, 1);");
     if (!defined('ENABLE_EDITOR')) {
         $lC_Database->simpleQuery("INSERT INTO `" . $pf . "configuration` (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES ('Enable/Disable Editor (Global)', 'ENABLE_EDITOR', '1', 'Enable or Disable Editor Globally', 20, 1, NULL, '2013-07-03 15:58:32', 'lc_cfg_use_get_boolean_value', 'lc_cfg_set_boolean_value(array(1, -1))');");
         parent::log("Database Update: INSERT INTO `" . $pf . "configuration` (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES ('Enable/Disable Editor (Global)', 'ENABLE_EDITOR', '1', 'Enable or Disable Editor Globally', 20, 1, NULL, '2013-07-03 15:58:32', 'lc_cfg_use_get_boolean_value', 'lc_cfg_set_boolean_value(array(1, -1))');");
     }
     if (!defined('USE_DEFAULT_TEMPLATE_STYLESHEET')) {
         $lC_Database->simpleQuery("INSERT INTO `" . $pf . "configuration` (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES ('Use Default Template Stylesheet', 'USE_DEFAULT_TEMPLATE_STYLESHEET', '-1', 'Use Default Template Stylesheet', 20, 2, NULL, '2013-07-03 15:58:32', 'lc_cfg_use_get_boolean_value', 'lc_cfg_set_boolean_value(array(1, -1))');");
         parent::log("Database Update: INSERT INTO `" . $pf . "configuration` (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES ('Use Default Template Stylesheet', 'USE_DEFAULT_TEMPLATE_STYLESHEET', '-1', 'Use Default Template Stylesheet', 20, 2, NULL, '2013-07-03 15:58:32', 'lc_cfg_use_get_boolean_value', 'lc_cfg_set_boolean_value(array(1, -1))');");
     }
     $lC_Database->simpleQuery("CREATE TABLE IF NOT EXISTS `" . $pf . "branding` (language_id INT(11) NOT NULL DEFAULT 1, slogan VARCHAR(256) NOT NULL DEFAULT '', meta_description VARCHAR(250) NOT NULL DEFAULT '', meta_keywords VARCHAR(128) NOT NULL DEFAULT '', meta_title VARCHAR(128) NOT NULL DEFAULT '', meta_title_prefix VARCHAR(128) NOT NULL, meta_title_suffix VARCHAR(128) NOT NULL, footer_text VARCHAR(256) NOT NULL DEFAULT '', PRIMARY KEY (language_id)) ENGINE=" . $engine . " CHARACTER SET utf8 COLLATE utf8_general_ci;");
     parent::log("Database Update: CREATE TABLE IF NOT EXISTS `" . $pf . "branding` (language_id INT(11) NOT NULL DEFAULT 1, slogan VARCHAR(256) NOT NULL DEFAULT '', meta_description VARCHAR(250) NOT NULL DEFAULT '', meta_keywords VARCHAR(128) NOT NULL DEFAULT '', meta_title VARCHAR(128) NOT NULL DEFAULT '', meta_title_prefix VARCHAR(128) NOT NULL, meta_title_suffix VARCHAR(128) NOT NULL, footer_text VARCHAR(256) NOT NULL DEFAULT '', PRIMARY KEY (language_id)) ENGINE=" . $engine . " CHARACTER SET utf8 COLLATE utf8_general_ci;");
     $lC_Database->simpleQuery("CREATE TABLE IF NOT EXISTS `" . $pf . "branding_data` (site_image VARCHAR(128) NOT NULL DEFAULT '', chat_code VARCHAR(8192) NOT NULL DEFAULT '', support_phone VARCHAR(16) NOT NULL DEFAULT '', support_email VARCHAR(128) NOT NULL DEFAULT '', sales_phone VARCHAR(16) NOT NULL DEFAULT '', sales_email VARCHAR(128) NOT NULL DEFAULT '', og_image VARCHAR(128) NOT NULL DEFAULT '', meta_delimeter VARCHAR(128) NOT NULL DEFAULT '', social_facebook_page VARCHAR(128) NOT NULL, social_twitter VARCHAR(128) NOT NULL, social_pinterest VARCHAR(128) NOT NULL, social_google_plus VARCHAR(128) NOT NULL, social_youtube VARCHAR(128) NOT NULL, social_linkedin VARCHAR(128) NOT NULL) ENGINE=" . $engine . " CHARACTER SET utf8 COLLATE utf8_general_ci;");
     parent::log("Database Update: CREATE TABLE IF NOT EXISTS `" . $pf . "branding_data` (site_image VARCHAR(128) NOT NULL DEFAULT '', chat_code VARCHAR(8192) NOT NULL DEFAULT '', support_phone VARCHAR(16) NOT NULL DEFAULT '', support_email VARCHAR(128) NOT NULL DEFAULT '', sales_phone VARCHAR(16) NOT NULL DEFAULT '', sales_email VARCHAR(128) NOT NULL DEFAULT '', og_image VARCHAR(128) NOT NULL DEFAULT '', meta_delimeter VARCHAR(128) NOT NULL DEFAULT '', social_facebook_page VARCHAR(128) NOT NULL, social_twitter VARCHAR(128) NOT NULL, social_pinterest VARCHAR(128) NOT NULL, social_google_plus VARCHAR(128) NOT NULL, social_youtube VARCHAR(128) NOT NULL, social_linkedin VARCHAR(128) NOT NULL) ENGINE=" . $engine . " CHARACTER SET utf8 COLLATE utf8_general_ci;");
     if (defined('DEFAULT_TEMPLATE') && DEFAULT_TEMPLATE == 'default') {
         $lC_Database->simpleQuery("UPDATE `" . $pf . "configuration` SET `configuration_value` = 'core' where `configuration_key` = 'DEFAULT_TEMPLATE';");
         parent::log("Database Update: UPDATE `" . $pf . "configuration` SET `configuration_value` = 'core' where `configuration_key` = 'DEFAULT_TEMPLATE';");
     }
     $lC_Database->simpleQuery("UPDATE `" . $pf . "configuration` SET `configuration_value` = '100' where `configuration_key` = 'MODULE_ORDER_TOTAL_SUBTOTAL_SORT_ORDER';");
     parent::log("Database Update: UPDATE `" . $pf . "configuration` SET `configuration_value` = '100' where `configuration_key` = 'MODULE_ORDER_TOTAL_SUBTOTAL_SORT_ORDER';");
     $lC_Database->simpleQuery("UPDATE `" . $pf . "configuration` SET `configuration_value` = '200' where `configuration_key` = 'MODULE_ORDER_TOTAL_SHIPPING_SORT_ORDER';");
     parent::log("Database Update: UPDATE `" . $pf . "configuration` SET `configuration_value` = '200' where `configuration_key` = 'MODULE_ORDER_TOTAL_SHIPPING_SORT_ORDER';");
     $lC_Database->simpleQuery("UPDATE `" . $pf . "configuration` SET `configuration_value` = '300' where `configuration_key` = 'MODULE_ORDER_TOTAL_COUPON_SORT_ORDER';");
     parent::log("Database Update: UPDATE `" . $pf . "configuration` SET `configuration_value` = '300' where `configuration_key` = 'MODULE_ORDER_TOTAL_COUPON_SORT_ORDER';");
     $lC_Database->simpleQuery("UPDATE `" . $pf . "configuration` SET `configuration_value` = '500' where `configuration_key` = 'MODULE_ORDER_TOTAL_TAX_SORT_ORDER';");
     parent::log("Database Update: UPDATE `" . $pf . "configuration` SET `configuration_value` = '500' where `configuration_key` = 'MODULE_ORDER_TOTAL_TAX_SORT_ORDER';");
     $lC_Database->simpleQuery("UPDATE `" . $pf . "configuration` SET `configuration_value` = '600' where `configuration_key` = 'MODULE_ORDER_TOTAL_TOTAL_SORT_ORDER';");
     parent::log("Database Update: UPDATE `" . $pf . "configuration` SET `configuration_value` = '600' where `configuration_key` = 'MODULE_ORDER_TOTAL_TOTAL_SORT_ORDER';");
     $lC_Database->simpleQuery("UPDATE `" . $pf . "configuration` SET `configuration_value` = '-1' where `configuration_key` = 'USE_DEFAULT_TEMPLATE_STYLESHEET';");
     parent::log("Database Update: UPDATE `" . $pf . "configuration` SET `configuration_value` = '-1' where `configuration_key` = 'USE_DEFAULT_TEMPLATE_STYLESHEET';");
     $lC_Database->simpleQuery("UPDATE `" . $pf . "configuration` SET `configuration_title` = 'Tag Cloud Maximum Listings' where `configuration_key` = 'TAG_CLOUD_MAX_LIST';");
     parent::log("Database Update: UPDATE `" . $pf . "configuration` SET `configuration_title` = 'Tag Cloud Maximum Listings' where `configuration_key` = 'TAG_CLOUD_MAX_LIST';");
     $lC_Database->simpleQuery("CREATE TABLE IF NOT EXISTS `" . $pf . "featured_products` (id int(11) NOT NULL AUTO_INCREMENT, products_id int(11) NOT NULL DEFAULT '0', date_added datetime NOT NULL DEFAULT '0000-00-00 00:00:00', last_modified datetime NOT NULL DEFAULT '0000-00-00 00:00:00', expires_date datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `status` int(1) DEFAULT '1', PRIMARY KEY (id)) ENGINE=" . $engine . " CHARACTER SET utf8 COLLATE utf8_general_ci;");
     parent::log("Database Update: CREATE TABLE IF NOT EXISTS `" . $pf . "featured_products` (id int(11) NOT NULL AUTO_INCREMENT, products_id int(11) NOT NULL DEFAULT '0', date_added datetime NOT NULL DEFAULT '0000-00-00 00:00:00', last_modified datetime NOT NULL DEFAULT '0000-00-00 00:00:00', expires_date datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `status` int(1) DEFAULT '1', PRIMARY KEY (id)) ENGINE=" . $engine . " CHARACTER SET utf8 COLLATE utf8_general_ci;");
     $lC_Database->simpleQuery("UPDATE `" . $pf . "configuration` SET `configuration_key` = 'AUTODISABLE_OUT_OF_STOCK_PRODUCT',`configuration_title` = 'Autodisable out of stock product',`configuration_description` = 'Set product as IN-ACTIVE if there is insufficient stock that is 0 or below' WHERE `configuration_id` = 61;");
     parent::log("Database Update: UPDATE `" . $pf . "configuration` SET `configuration_key` = 'AUTODISABLE_OUT_OF_STOCK_PRODUCT',`configuration_title` = 'Autodisable out of stock product',`configuration_description` = 'Set product as IN-ACTIVE if there is insufficient stock that is 0 or below' WHERE `configuration_id` = 61;");
     if (!defined('DISABLE_ADD_TO_CART')) {
         $lC_Database->simpleQuery("INSERT INTO `" . $pf . "configuration` (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES('Disable Add to Cart for out of stock products', 'DISABLE_ADD_TO_CART', '1', 'Disabled the add to cart button on the product page displays text that product is out of stock', 9, 3, NULL, '2009-11-26 15:58:32', 'lc_cfg_use_get_boolean_value', 'lc_cfg_set_boolean_value(array(1, -1))');");
         parent::log("Database Update: INSERT INTO `" . $pf . "configuration` (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES('Disable Add to Cart for out of stock products', 'DISABLE_ADD_TO_CART', '1', 'Disabled the add to cart button on the product page displays text that product is out of stock', 9, 3, NULL, '2009-11-26 15:58:32', 'lc_cfg_use_get_boolean_value', 'lc_cfg_set_boolean_value(array(1, -1))');");
     }
     if (!defined('EDITOR_CONFIGURATION_PRODUCT')) {
         $lC_Database->simpleQuery("INSERT INTO `" . $pf . "configuration` (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES('Product Description Editor Configuration', 'EDITOR_CONFIGURATION_PRODUCT', 'Minimum', 'Set Product description editor configuration.', 20, 3, NULL, now(), NULL, 'lc_cfg_set_boolean_value(array(''Off'',''Minimum'', ''Standard'',''Full''))');");
         parent::log("Database Update: INSERT INTO `" . $pf . "configuration` (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES('Product Description Editor Configuration', 'EDITOR_CONFIGURATION_PRODUCT', 'Minimum', 'Set Product description editor configuration.', 20, 3, NULL, now(), NULL, 'lc_cfg_set_boolean_value(array(''Off'',''Minimum'', ''Standard'',''Full''))');");
     }
     if (!defined('EDITOR_CONFIGURATION_CATEGORY')) {
         $lC_Database->simpleQuery("INSERT INTO `" . $pf . "configuration` (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES('Category Description Editor Configuration', 'EDITOR_CONFIGURATION_CATEGORY', 'Full', 'Set Category description editor configuration.', 20, 4, NULL, now(), NULL, 'lc_cfg_set_boolean_value(array(''Off'',''Minimum'', ''Standard'',''Full''))');");
         parent::log("Database Update: INSERT INTO `" . $pf . "configuration` (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES('Category Description Editor Configuration', 'EDITOR_CONFIGURATION_CATEGORY', 'Full', 'Set Category description editor configuration.', 20, 4, NULL, now(), NULL, 'lc_cfg_set_boolean_value(array(''Off'',''Minimum'', ''Standard'',''Full''))');");
     }
     if (!defined('EDITOR_CONFIGURATION_HOMEPAGE')) {
         $lC_Database->simpleQuery("INSERT INTO `" . $pf . "configuration` (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES('Home Page Editor Configuration', 'EDITOR_CONFIGURATION_HOMEPAGE', 'Full', 'Set Home Page editor configuration.', 20, 5, NULL, now(), NULL, 'lc_cfg_set_boolean_value(array(''Off'',''Minimum'', ''Standard'',''Full''))');");
         parent::log("Database Update: INSERT INTO `" . $pf . "configuration` (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES('Home Page Editor Configuration', 'EDITOR_CONFIGURATION_HOMEPAGE', 'Full', 'Set Home Page editor configuration.', 20, 5, NULL, now(), NULL, 'lc_cfg_set_boolean_value(array(''Off'',''Minimum'', ''Standard'',''Full''))');");
     }
     if (!defined('EDITOR_UPLOADCARE_PUBLIC_KEY')) {
         $lC_Database->simpleQuery("INSERT IGNORE INTO `" . $pf . "configuration` (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES('Uploadcare Public Key', 'EDITOR_UPLOADCARE_PUBLIC_KEY', '', 'Add your Uploadcare public key. <a href=\"https://uploadcare.com/accounts/settings/\" target=\"_blank\">Get your Uploadcare Public Key</a>', 20, 6, NULL, now(), NULL, NULL);");
         parent::log("Database Update: INSERT INTO `" . $pf . "configuration` (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES('Uploadcare Public Key', 'EDITOR_UPLOADCARE_PUBLIC_KEY', '', 'Add your Uploadcare public key. <a href=\"https://uploadcare.com/accounts/settings/\" target=\"_blank\">Get your Uploadcare Public Key</a>', 20, 6, NULL, now(), NULL, NULL);");
     }
     $lC_Database->simpleQuery("ALTER IGNORE TABLE `" . $pf . "branding` ADD `homepage_text` VARCHAR(20000) NOT NULL DEFAULT '' AFTER `language_id`;");
     parent::log("Database Update: ALTER IGNORE TABLE `" . $pf . "branding` ADD `homepage_text` VARCHAR(20000) NOT NULL DEFAULT '' AFTER `language_id`;");
     $lC_Database->simpleQuery("UPDATE `" . $pf . "currencies` SET `symbol_left` = '&euro;' where `code` = 'EUR';");
     parent::log("Database Update: UPDATE `" . $pf . "currencies` SET `symbol_left` = '&euro;' where `code` = 'EUR';");
     $lC_Database->simpleQuery("UPDATE `" . $pf . "currencies` SET `symbol_left` = '&pound;' where `code` = 'GBP';");
     parent::log("Database Update: UPDATE `" . $pf . "currencies` SET `symbol_left` = '&pound;' where `code` = 'GBP';");
     // default values update
     $lC_Database->simpleQuery("ALTER IGNORE TABLE `" . $pf . "orders_status_history` ADD `administrators_id` INT( 11 ) NOT NULL DEFAULT '0' AFTER `comments`;");
     parent::log("Database Update: ALTER IGNORE TABLE `" . $pf . "orders_status_history` ADD `administrators_id` INT( 11 ) NOT NULL DEFAULT '0' AFTER `comments`;");
     $lC_Database->simpleQuery("ALTER IGNORE TABLE `" . $pf . "administrators` CHANGE `first_name` `first_name` VARCHAR(64) NOT NULL DEFAULT '', CHANGE `last_name` `last_name` VARCHAR(64) NOT NULL DEFAULT '', CHANGE `image` `image` VARCHAR(255) NOT NULL DEFAULT '', CHANGE `access_group_id` `access_group_id` INT(11) NOT NULL DEFAULT '0', CHANGE `verify_key` `verify_key` VARCHAR(64) NOT NULL DEFAULT '';");
     parent::log("Database Update: ALTER IGNORE TABLE `" . $pf . "administrators` CHANGE `first_name` `first_name` VARCHAR(64) NOT NULL DEFAULT '', CHANGE `last_name` `last_name` VARCHAR(64) NOT NULL DEFAULT '', CHANGE `image` `image` VARCHAR(255) NOT NULL DEFAULT '', CHANGE `access_group_id` `access_group_id` INT(11) NOT NULL DEFAULT '0', CHANGE `verify_key` `verify_key` VARCHAR(64) NOT NULL DEFAULT '';");
     $lC_Database->simpleQuery("ALTER IGNORE TABLE `" . $pf . "administrators_access` CHANGE `administrators_id` `administrators_id` INT(11) NOT NULL DEFAULT '0', CHANGE `administrators_groups_id` `administrators_groups_id` INT(11) NOT NULL DEFAULT '0', CHANGE `module` `module` VARCHAR(255) NOT NULL DEFAULT '', CHANGE `level` `level` INT(11) NOT NULL DEFAULT '0';");
     parent::log("Database Update: ALTER IGNORE TABLE `" . $pf . "administrators_access` CHANGE `administrators_id` `administrators_id` INT(11) NOT NULL DEFAULT '0', CHANGE `administrators_groups_id` `administrators_groups_id` INT(11) NOT NULL DEFAULT '0', CHANGE `module` `module` VARCHAR(255) NOT NULL DEFAULT '', CHANGE `level` `level` INT(11) NOT NULL DEFAULT '0';");
     $lC_Database->simpleQuery("ALTER IGNORE TABLE `" . $pf . "banners_history` CHANGE `banners_id` `banners_id` INT(11) NOT NULL DEFAULT '0', CHANGE `banners_shown` `banners_shown` INT(11) NOT NULL DEFAULT '0', CHANGE `banners_clicked` `banners_clicked` INT(11) NOT NULL DEFAULT '0';");
     parent::log("Database Update: ALTER IGNORE TABLE `" . $pf . "banners_history` CHANGE `banners_id` `banners_id` INT(11) NOT NULL DEFAULT '0', CHANGE `banners_shown` `banners_shown` INT(11) NOT NULL DEFAULT '0', CHANGE `banners_clicked` `banners_clicked` INT(11) NOT NULL DEFAULT '0';");
     $lC_Database->simpleQuery("ALTER IGNORE TABLE `" . $pf . "branding` CHANGE `homepage_text` `homepage_text` VARCHAR(20000) NOT NULL DEFAULT '', CHANGE `slogan` `slogan` VARCHAR(256) NOT NULL DEFAULT '', CHANGE `meta_description` `meta_description` VARCHAR(250) NOT NULL DEFAULT '', CHANGE `meta_keywords` `meta_keywords` VARCHAR(128) NOT NULL DEFAULT '', CHANGE `meta_title` `meta_title` VARCHAR(128) NOT NULL DEFAULT '', CHANGE `footer_text` `footer_text` VARCHAR(256) NOT NULL DEFAULT '';");
     parent::log("Database Update: ALTER IGNORE TABLE `" . $pf . "branding` CHANGE `homepage_text` `homepage_text` VARCHAR(20000) NOT NULL DEFAULT '', CHANGE `slogan` `slogan` VARCHAR(256) NOT NULL DEFAULT '', CHANGE `meta_description` `meta_description` VARCHAR(250) NOT NULL DEFAULT '', CHANGE `meta_keywords` `meta_keywords` VARCHAR(128) NOT NULL DEFAULT '', CHANGE `meta_title` `meta_title` VARCHAR(128) NOT NULL DEFAULT '', CHANGE `footer_text` `footer_text` VARCHAR(256) NOT NULL DEFAULT '';");
     $lC_Database->simpleQuery("ALTER IGNORE TABLE `" . $pf . "branding_data` CHANGE `site_image` `site_image` VARCHAR(128) NOT NULL DEFAULT '', CHANGE `chat_code` `chat_code` VARCHAR(8192) NOT NULL DEFAULT '', CHANGE `support_phone` `support_phone` VARCHAR(16) NOT NULL DEFAULT '', CHANGE `support_email` `support_email` VARCHAR(128) NOT NULL DEFAULT '', CHANGE `sales_phone` `sales_phone` VARCHAR(16) NOT NULL DEFAULT '', CHANGE `sales_email` `sales_email` VARCHAR(128) NOT NULL DEFAULT '', CHANGE `og_image` `og_image` VARCHAR(128) NOT NULL DEFAULT '', CHANGE `meta_delimeter` `meta_delimeter` VARCHAR(128) NOT NULL DEFAULT '';");
     parent::log("Database Update: ALTER IGNORE TABLE `" . $pf . "branding_data` CHANGE `site_image` `site_image` VARCHAR(128) NOT NULL DEFAULT '', CHANGE `chat_code` `chat_code` VARCHAR(8192) NOT NULL DEFAULT '', CHANGE `support_phone` `support_phone` VARCHAR(16) NOT NULL DEFAULT '', CHANGE `support_email` `support_email` VARCHAR(128) NOT NULL DEFAULT '', CHANGE `sales_phone` `sales_phone` VARCHAR(16) NOT NULL DEFAULT '', CHANGE `sales_email` `sales_email` VARCHAR(128) NOT NULL DEFAULT '', CHANGE `og_image` `og_image` VARCHAR(128) NOT NULL DEFAULT '', CHANGE `meta_delimeter` `meta_delimeter` VARCHAR(128) NOT NULL DEFAULT '';");
     $lC_Database->simpleQuery("ALTER IGNORE TABLE `" . $pf . "categories` CHANGE `parent_id` `parent_id` INT(11) NOT NULL DEFAULT '0', CHANGE `categories_link_target` `categories_link_target` TINYINT(1) NULL DEFAULT '0', CHANGE `categories_visibility_nav` `categories_visibility_nav` TINYINT(1) NULL DEFAULT '0';");
     parent::log("Database Update: ALTER IGNORE TABLE `" . $pf . "categories` CHANGE `parent_id` `parent_id` INT(11) NOT NULL DEFAULT '0', CHANGE `categories_link_target` `categories_link_target` TINYINT(1) NULL DEFAULT '0', CHANGE `categories_visibility_nav` `categories_visibility_nav` TINYINT(1) NULL DEFAULT '0';");
     $lC_Database->simpleQuery("ALTER IGNORE TABLE `" . $pf . "coupons` CHANGE `uses_per_coupon` `uses_per_coupon` INT(11) NOT NULL DEFAULT '0', CHANGE `uses_per_customer` `uses_per_customer` INT(11) NOT NULL DEFAULT '0', CHANGE `sale_exclude` `sale_exclude` TINYINT(1) NOT NULL DEFAULT '0';");
     parent::log("Database Update: ALTER IGNORE TABLE `" . $pf . "coupons` CHANGE `uses_per_coupon` `uses_per_coupon` INT(11) NOT NULL DEFAULT '0', CHANGE `uses_per_customer` `uses_per_customer` INT(11) NOT NULL DEFAULT '0', CHANGE `sale_exclude` `sale_exclude` TINYINT(1) NOT NULL DEFAULT '0';");
     $lC_Database->simpleQuery("ALTER IGNORE TABLE `" . $pf . "coupons_description` CHANGE `coupons_id` `coupons_id` INT(11) NOT NULL DEFAULT '0', CHANGE `name` `name` VARCHAR(1024) NOT NULL DEFAULT '';");
     parent::log("Database Update: ALTER IGNORE TABLE `" . $pf . "coupons_description` CHANGE `coupons_id` `coupons_id` INT(11) NOT NULL DEFAULT '0', CHANGE `name` `name` VARCHAR(1024) NOT NULL DEFAULT '';");
     $lC_Database->simpleQuery("ALTER IGNORE TABLE `" . $pf . "coupons_redeemed` CHANGE `coupons_id` `coupons_id` INT(11) NOT NULL DEFAULT '0', CHANGE `customers_id` `customers_id` INT(11) NOT NULL DEFAULT '0', CHANGE `redeem_ip` `redeem_ip` VARCHAR(32) NOT NULL DEFAULT '', CHANGE `order_id` `order_id` INT(11) NOT NULL DEFAULT '0';");
     parent::log("Database Update: ALTER IGNORE TABLE `" . $pf . "coupons_redeemed` CHANGE `coupons_id` `coupons_id` INT(11) NOT NULL DEFAULT '0', CHANGE `customers_id` `customers_id` INT(11) NOT NULL DEFAULT '0', CHANGE `redeem_ip` `redeem_ip` VARCHAR(32) NOT NULL DEFAULT '', CHANGE `order_id` `order_id` INT(11) NOT NULL DEFAULT '0';");
     $lC_Database->simpleQuery("ALTER IGNORE TABLE `" . $pf . "featured_products` CHANGE `products_id` `products_id` INT(11) NOT NULL DEFAULT '0';");
     parent::log("Database Update: ALTER IGNORE TABLE `" . $pf . "featured_products` CHANGE `products_id` `products_id` INT(11) NOT NULL DEFAULT '0';");
     $lC_Database->simpleQuery("ALTER IGNORE TABLE `" . $pf . "manufacturers_info` CHANGE `url_clicked` `url_clicked` INT(11) NOT NULL DEFAULT '0';");
     parent::log("Database Update: ALTER IGNORE TABLE `" . $pf . "manufacturers_info` CHANGE `url_clicked` `url_clicked` INT(11) NOT NULL DEFAULT '0';");
     $lC_Database->simpleQuery("ALTER IGNORE TABLE `" . $pf . "orders_status_history` CHANGE `administrators_id` `administrators_id` INT(11) NOT NULL DEFAULT '0';");
     parent::log("Database Update: ALTER IGNORE TABLE `" . $pf . "orders_status_history` CHANGE `administrators_id` `administrators_id` INT(11) NOT NULL DEFAULT '0';");
     $lC_Database->simpleQuery("ALTER IGNORE TABLE `" . $pf . "products` CHANGE `parent_id` `parent_id` INT(11) NULL DEFAULT '0', CHANGE `products_quantity` `products_quantity` INT(11) NOT NULL DEFAULT '0', CHANGE `products_weight_class` `products_weight_class` INT(11) NOT NULL DEFAULT '0', CHANGE `products_status` `products_status` TINYINT(1) NOT NULL DEFAULT '0', CHANGE `products_tax_class_id` `products_tax_class_id` INT(11) NOT NULL DEFAULT '0', CHANGE `products_ordered` `products_ordered` INT(11) NOT NULL DEFAULT '0';");
     parent::log("Database Update: ALTER IGNORE TABLE `" . $pf . "products` CHANGE `parent_id` `parent_id` INT(11) NULL DEFAULT '0', CHANGE `products_quantity` `products_quantity` INT(11) NOT NULL DEFAULT '0', CHANGE `products_weight_class` `products_weight_class` INT(11) NOT NULL DEFAULT '0', CHANGE `products_status` `products_status` TINYINT(1) NOT NULL DEFAULT '0', CHANGE `products_tax_class_id` `products_tax_class_id` INT(11) NOT NULL DEFAULT '0', CHANGE `products_ordered` `products_ordered` INT(11) NOT NULL DEFAULT '0';");
     $lC_Database->simpleQuery("ALTER IGNORE TABLE `" . $pf . "products_simple_options` CHANGE `sort_order` `sort_order` INT(11) NOT NULL DEFAULT '0';");
     parent::log("Database Update: ALTER IGNORE TABLE `" . $pf . "products_simple_options` CHANGE `sort_order` `sort_order` INT(11) NOT NULL DEFAULT '0';");
     $lC_Database->simpleQuery("ALTER IGNORE TABLE `" . $pf . "products_simple_options_values` CHANGE `sort_order` `sort_order` INT(11) NOT NULL DEFAULT '0';");
     parent::log("Database Update: ALTER IGNORE TABLE `" . $pf . "products_simple_options_values` CHANGE `sort_order` `sort_order` INT(11) NOT NULL DEFAULT '0';");
     $lC_Database->simpleQuery("ALTER IGNORE TABLE `" . $pf . "reviews` CHANGE `products_id` `products_id` INT(11) NOT NULL DEFAULT '0', CHANGE `reviews_read` `reviews_read` INT(11) NOT NULL DEFAULT '0', CHANGE `reviews_status` `reviews_status` TINYINT(1) NOT NULL DEFAULT '0';");
     parent::log("Database Update: ALTER IGNORE TABLE `" . $pf . "reviews` CHANGE `products_id` `products_id` INT(11) NOT NULL DEFAULT '0', CHANGE `reviews_read` `reviews_read` INT(11) NOT NULL DEFAULT '0', CHANGE `reviews_status` `reviews_status` TINYINT(1) NOT NULL DEFAULT '0';");
     $lC_Database->simpleQuery("ALTER IGNORE TABLE `" . $pf . "product_attributes` ADD INDEX(`idx_pa_products_id`);");
     parent::log("Database Update: ALTER IGNORE TABLE `" . $pf . "product_attributes` ADD INDEX(`idx_pa_products_id`);");
     $lC_Database->simpleQuery("ALTER IGNORE TABLE `" . $pf . "updates_log` CHANGE `action` `action` VARCHAR(32) NOT NULL DEFAULT '', CHANGE `result` `result` VARCHAR(128) NOT NULL DEFAULT '', CHANGE `user` `user` VARCHAR(64) NOT NULL DEFAULT '';");
     parent::log("Database Update: ALTER IGNORE TABLE `" . $pf . "updates_log` CHANGE `action` `action` VARCHAR(32) NOT NULL DEFAULT '', CHANGE `result` `result` VARCHAR(128) NOT NULL DEFAULT '', CHANGE `user` `user` VARCHAR(64) NOT NULL DEFAULT '';");
     $lC_Database->simpleQuery("ALTER IGNORE TABLE `" . $pf . "branding_data` ADD COLUMN `custom_css` text NOT NULL;");
     parent::log("Database Update: ALTER IGNORE TABLE `" . $pf . "branding_data` ADD COLUMN `custom_css` text NOT NULL;");
     $lC_Database->simpleQuery("ALTER IGNORE TABLE `" . $pf . "products_variants` ADD `default_visual` INT( 11 ) DEFAULT '0' AFTER `default_combo`;");
     parent::log("Database Update: ALTER IGNORE TABLE `" . $pf . "products_variants` ADD `default_visual` INT( 11 ) DEFAULT '0' AFTER `default_combo`;");
     $lC_Database->simpleQuery("ALTER IGNORE TABLE `" . $pf . "products_variants_values` ADD `visual` VARCHAR( 1024 ) DEFAULT NULL AFTER `title`;");
     parent::log("Database Update: ALTER IGNORE TABLE `" . $pf . "products_variants_values` ADD `visual` VARCHAR( 1024 ) DEFAULT NULL AFTER `title`;");
     // missing weight class rules
     $lC_Database->simpleQuery("INSERT IGNORE INTO `" . $pf . "weight_classes_rules` (weight_class_from_id, weight_class_to_id, weight_class_rule) VALUES (1, 2, 0.0010);");
     parent::log("Database Update: INSERT IGNORE INTO `" . $pf . "weight_classes_rules` (weight_class_from_id, weight_class_to_id, weight_class_rule) VALUES (1, 2, 0.0010);");
     $lC_Database->simpleQuery("INSERT IGNORE INTO `" . $pf . "weight_classes_rules` (weight_class_from_id, weight_class_to_id, weight_class_rule) VALUES (1, 3, 0.0352);");
     parent::log("Database Update: INSERT IGNORE INTO `" . $pf . "weight_classes_rules` (weight_class_from_id, weight_class_to_id, weight_class_rule) VALUES (1, 3, 0.0352);");
     $lC_Database->simpleQuery("INSERT IGNORE INTO `" . $pf . "weight_classes_rules` (weight_class_from_id, weight_class_to_id, weight_class_rule) VALUES (1, 4, 0.0022);");
     parent::log("Database Update: INSERT IGNORE INTO `" . $pf . "weight_classes_rules` (weight_class_from_id, weight_class_to_id, weight_class_rule) VALUES (1, 4, 0.0022);");
     $lC_Database->simpleQuery("INSERT IGNORE INTO `" . $pf . "weight_classes_rules` (weight_class_from_id, weight_class_to_id, weight_class_rule) VALUES (2, 1, 1000.0000);");
     parent::log("Database Update: INSERT IGNORE INTO `" . $pf . "weight_classes_rules` (weight_class_from_id, weight_class_to_id, weight_class_rule) VALUES (2, 1, 1000.0000);");
     $lC_Database->simpleQuery("INSERT IGNORE INTO `" . $pf . "weight_classes_rules` (weight_class_from_id, weight_class_to_id, weight_class_rule) VALUES (2, 3, 35.2739);");
     parent::log("Database Update: INSERT IGNORE INTO `" . $pf . "weight_classes_rules` (weight_class_from_id, weight_class_to_id, weight_class_rule) VALUES (2, 3, 35.2739);");
     $lC_Database->simpleQuery("INSERT IGNORE INTO `" . $pf . "weight_classes_rules` (weight_class_from_id, weight_class_to_id, weight_class_rule) VALUES (2, 4, 2.2046);");
     parent::log("Database Update: INSERT IGNORE INTO `" . $pf . "weight_classes_rules` (weight_class_from_id, weight_class_to_id, weight_class_rule) VALUES (2, 4, 2.2046);");
     $lC_Database->simpleQuery("INSERT IGNORE INTO `" . $pf . "weight_classes_rules` (weight_class_from_id, weight_class_to_id, weight_class_rule) VALUES (3, 1, 28.3495);");
     parent::log("Database Update: INSERT IGNORE INTO `" . $pf . "weight_classes_rules` (weight_class_from_id, weight_class_to_id, weight_class_rule) VALUES (3, 1, 28.3495);");
     $lC_Database->simpleQuery("INSERT IGNORE INTO `" . $pf . "weight_classes_rules` (weight_class_from_id, weight_class_to_id, weight_class_rule) VALUES (3, 2, 0.0283);");
     parent::log("Database Update: INSERT IGNORE INTO `" . $pf . "weight_classes_rules` (weight_class_from_id, weight_class_to_id, weight_class_rule) VALUES (3, 2, 0.0283);");
     $lC_Database->simpleQuery("INSERT IGNORE INTO `" . $pf . "weight_classes_rules` (weight_class_from_id, weight_class_to_id, weight_class_rule) VALUES (3, 4, 0.0625);");
     parent::log("Database Update: INSERT IGNORE INTO `" . $pf . "weight_classes_rules` (weight_class_from_id, weight_class_to_id, weight_class_rule) VALUES (3, 4, 0.0625);");
     $lC_Database->simpleQuery("INSERT IGNORE INTO `" . $pf . "weight_classes_rules` (weight_class_from_id, weight_class_to_id, weight_class_rule) VALUES (4, 1, 453.5923);");
     parent::log("Database Update: INSERT IGNORE INTO `" . $pf . "weight_classes_rules` (weight_class_from_id, weight_class_to_id, weight_class_rule) VALUES (4, 1, 453.5923);");
     $lC_Database->simpleQuery("INSERT IGNORE INTO `" . $pf . "weight_classes_rules` (weight_class_from_id, weight_class_to_id, weight_class_rule) VALUES (4, 2, 0.4535);");
     parent::log("Database Update: INSERT IGNORE INTO `" . $pf . "weight_classes_rules` (weight_class_from_id, weight_class_to_id, weight_class_rule) VALUES (4, 2, 0.4535);");
     $lC_Database->simpleQuery("INSERT IGNORE INTO `" . $pf . "weight_classes_rules` (weight_class_from_id, weight_class_to_id, weight_class_rule) VALUES (4, 3, 16.0000);");
     parent::log("Database Update: INSERT IGNORE INTO `" . $pf . "weight_classes_rules` (weight_class_from_id, weight_class_to_id, weight_class_rule) VALUES (4, 3, 16.0000);");
     $lC_Database->simpleQuery("UPDATE `" . $pf . "currencies` SET `symbol_left` = '&euro;' where `code` = 'EUR';");
     parent::log("Database Update: UPDATE `" . $pf . "currencies` SET `symbol_left` = '&euro;' where `code` = 'EUR';");
     $lC_Database->simpleQuery("UPDATE `" . $pf . "currencies` SET `symbol_left` = '&pound;' where `code` = 'GBP';");
     parent::log("Database Update: UPDATE `" . $pf . "currencies` SET `symbol_left` = '&pound;' where `code` = 'GBP';");
     $lC_Database->simpleQuery("INSERT IGNORE INTO `" . $pf . "configuration_group` (configuration_group_id, configuration_group_title, configuration_group_description, sort_order, visible) VALUES (10, 'Sessions', 'Session settings', 10, 1);");
     parent::log("Database Update: INSERT IGNORE INTO `" . $pf . "configuration_group` (configuration_group_id, configuration_group_title, configuration_group_description, sort_order, visible) VALUES (10, 'Sessions', 'Session settings', 10, 1);");
     if (!defined('SESSION_LIFETIME')) {
         $lC_Database->simpleQuery("INSERT INTO `" . $pf . "configuration` (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES('Session Lifetime', 'SESSION_LIFETIME', 3600, 'The amount of time a user is logged in for after the last action in seconds.', 10, 0, now(), now(), NULL, NULL);");
         parent::log("Database Update: INSERT INTO `" . $pf . "configuration` (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES('Session Lifetime', 'SESSION_LIFETIME', 3600, 'The amount of time a user is logged in for after the last action in seconds.', 10, 0, now(), now(), NULL, NULL);");
     }
     $lC_Database->simpleQuery("CREATE TABLE IF NOT EXISTS `" . $pf . "customers_access` (id int(11) NOT NULL AUTO_INCREMENT, `level` varchar(128) NOT NULL DEFAULT '', `status` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (id)) ENGINE=" . $engine . " CHARACTER SET utf8 COLLATE utf8_general_ci");
     parent::log("Database Update: CREATE TABLE IF NOT EXISTS `" . $pf . "customers_access` (id int(11) NOT NULL AUTO_INCREMENT, `level` varchar(128) NOT NULL DEFAULT '', `status` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (id)) ENGINE=" . $engine . " CHARACTER SET utf8 COLLATE utf8_general_ci");
     $lC_Database->simpleQuery("ALTER IGNORE TABLE `" . $pf . "customers_groups_data` ADD `customers_access_levels` VARCHAR(255) NOT NULL DEFAULT '';");
     parent::log("Database Update: ALTER IGNORE TABLE `" . $pf . "customers_groups_data` ADD `customers_access_levels` VARCHAR(255) NOT NULL DEFAULT '';");
     $lC_Database->simpleQuery("ALTER IGNORE TABLE `" . $pf . "customers_groups_data` ADD `hidden_products_notification` TINYINT(1) NOT NULL DEFAULT '0';");
     parent::log("Database Update: ALTER IGNORE TABLE `" . $pf . "customers_groups_data` ADD `hidden_products_notification` TINYINT(1) NOT NULL DEFAULT '0';");
     $lC_Database->simpleQuery("ALTER IGNORE TABLE `" . $pf . "customers_groups_data` ADD `taxable` TINYINT(1) NOT NULL DEFAULT '0';");
     parent::log("Database Update: ALTER IGNORE TABLE `" . $pf . "customers_groups_data` ADD `taxable` TINYINT(1) NOT NULL DEFAULT '0';");
     $lC_Database->simpleQuery("ALTER IGNORE TABLE `" . $pf . "customers_groups_data` ADD `payment_modules` VARCHAR(255) NOT NULL DEFAULT '';");
     parent::log("Database Update: ALTER IGNORE TABLE `" . $pf . "customers_groups_data` ADD `payment_modules` VARCHAR(255) NOT NULL DEFAULT '';");
     $lC_Database->simpleQuery("ALTER IGNORE TABLE `" . $pf . "customers_groups_data` ADD `shipping_modules` VARCHAR(255) NOT NULL DEFAULT '';");
     parent::log("Database Update: ALTER IGNORE TABLE `" . $pf . "customers_groups_data` ADD `shipping_modules` VARCHAR(255) NOT NULL DEFAULT '';");
     $lC_Database->simpleQuery("ALTER IGNORE TABLE `" . $pf . "products` ADD `access_levels` VARCHAR(255) NOT NULL DEFAULT '';");
     parent::log("Database Update: ALTER IGNORE TABLE `" . $pf . "products` ADD `access_levels` VARCHAR(255) NOT NULL DEFAULT '';");
     $lC_Database->simpleQuery("ALTER IGNORE TABLE `" . $pf . "categories` ADD `access_levels` VARCHAR(255) NOT NULL DEFAULT '';");
     parent::log("Database Update: ALTER IGNORE TABLE `" . $pf . "categories` ADD `access_levels` VARCHAR(255) NOT NULL DEFAULT '';");
     $lC_Database->simpleQuery("INSERT IGNORE INTO `" . $pf . "customers_access` (id, level, status) VALUES (1, 'Guest', 1)");
     parent::log("Database Update: INSERT IGNORE INTO `" . $pf . "customers_access` (id, level, status) VALUES (1, 'Guest', 1)");
     $lC_Database->simpleQuery("INSERT IGNORE INTO `" . $pf . "customers_access` (id, level, status) VALUES (2, 'Registered', 1)");
     parent::log("Database Update: INSERT IGNORE INTO `" . $pf . "customers_access` (id, level, status) VALUES (2, 'Registered', 1)");
     if (!defined('SESSION_FORCE_COOKIES')) {
         $lC_Database->simpleQuery("INSERT INTO `" . $pf . "configuration` (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES('Force Cookie Use', 'SESSION_FORCE_COOKIES', -1, 'Force the use cookies to handle sessions.', 10, 0, now(), now(), 'lc_cfg_use_get_boolean_value', 'lc_cfg_set_boolean_value(array(1, -1))');");
         parent::log("Database Update: INSERT INTO `" . $pf . "configuration` (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES('Force Cookie Use', 'SESSION_FORCE_COOKIES', -1, 'Force the use cookies to handle sessions.', 10, 0, now(), now(), 'lc_cfg_use_get_boolean_value', 'lc_cfg_set_boolean_value(array(1, -1))');");
     }
     $lC_Database->simpleQuery("ALTER IGNORE TABLE `" . $pf . "orders_products` ADD COLUMN `products_sku` VARCHAR(255) DEFAULT NULL AFTER `products_model`;");
     parent::log("Database Update: ALTER IGNORE TABLE `" . $pf . "orders_products` ADD COLUMN `products_sku` VARCHAR(255) DEFAULT NULL AFTER `products_model`;");
     $lC_Database->simpleQuery("INSERT IGNORE INTO `" . $pf . "configuration_group` (configuration_group_id, configuration_group_title, configuration_group_description, sort_order, visible) VALUES (22, 'File Uploads', 'File Upload Settings', 13, 1)");
     parent::log("Database Update: INSERT IGNORE INTO `" . $pf . "configuration_group` (configuration_group_id, configuration_group_title, configuration_group_description, sort_order, visible) VALUES (22, 'File Uploads', 'File Upload Settings', 13, 1)");
     if (!defined('PRODUCT_MODULES_FILE_UPLOAD_TYPES')) {
         $lC_Database->simpleQuery("INSERT INTO `" . $pf . "configuration` (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES('Allowed File Types', 'PRODUCT_MODULES_FILE_UPLOAD_TYPES', '.zip,.pdf,.png,.gif,.jpg,.tiff,.gzip,.gz', 'Enter the allowed file upload extensions in a comma delimited format.', 22, 0, now(), now(), NULL, NULL)");
         parent::log("Database Update: INSERT INTO `" . $pf . "configuration` (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES('Allowed File Types', 'PRODUCT_MODULES_FILE_UPLOAD_TYPES', '.zip,.pdf,.png,.gif,.jpg,.tiff,.gzip,.gz', 'Enter the allowed file upload extensions in a comma delimited format.', 22, 0, now(), now(), NULL, NULL)");
     }
     $lC_Database->simpleQuery("INSERT IGNORE INTO `" . $pf . "configuration_group` (configuration_group_id, configuration_group_title, configuration_group_description, sort_order, visible) VALUES (23, 'Product Info Page', 'Settings specific to the product information page.', 8, 1);");
     parent::log("Database Update: INSERT IGNORE INTO `" . $pf . "configuration_group` (configuration_group_id, configuration_group_title, configuration_group_description, sort_order, visible) VALUES (23, 'Product Info Page', 'Settings specific to the product information page.', 8, 1);");
     if (!defined('PRODUCT_INFO_SOCIAL_SHARE_FACEBOOK')) {
         $lC_Database->simpleQuery("INSERT IGNORE INTO `" . $pf . "configuration` (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES('Enable Facebook Share Icon', 'PRODUCT_INFO_SOCIAL_SHARE_FACEBOOK', 1, 'Allow people to share with Facebook', 23, 0, now(), now(), 'lc_cfg_use_get_boolean_value', 'lc_cfg_set_boolean_value(array(1, -1))');");
         parent::log("Database Update: INSERT INTO `" . $pf . "configuration` (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES('Enable Facebook Share Icon', 'PRODUCT_INFO_SOCIAL_SHARE_FACEBOOK', 1, 'Allow people to share with Facebook', 23, 0, now(), now(), 'lc_cfg_use_get_boolean_value', 'lc_cfg_set_boolean_value(array(1, -1))');");
     }
     if (!defined('PRODUCT_INFO_SOCIAL_SHARE_TWITTER')) {
         $lC_Database->simpleQuery("INSERT IGNORE INTO `" . $pf . "configuration` (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES('Enable Twitter Share Icon', 'PRODUCT_INFO_SOCIAL_SHARE_TWITTER', 1, 'Allow people to share with Twitter', 23, 1, now(), now(), 'lc_cfg_use_get_boolean_value', 'lc_cfg_set_boolean_value(array(1, -1))');");
         parent::log("Database Update: INSERT INTO `" . $pf . "configuration` (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES('Enable Twitter Share Icon', 'PRODUCT_INFO_SOCIAL_SHARE_TWITTER', 1, 'Allow people to share with Twitter', 23, 1, now(), now(), 'lc_cfg_use_get_boolean_value', 'lc_cfg_set_boolean_value(array(1, -1))');");
     }
     if (!defined('PRODUCT_INFO_SOCIAL_SHARE_GOOGLE')) {
         $lC_Database->simpleQuery("INSERT IGNORE INTO `" . $pf . "configuration` (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES('Enable Google+ Share Icon', 'PRODUCT_INFO_SOCIAL_SHARE_GOOGLE', 1, 'Allow people to share with Google+', 23, 2, now(), now(), 'lc_cfg_use_get_boolean_value', 'lc_cfg_set_boolean_value(array(1, -1))');");
         parent::log("Database Update: INSERT INTO `" . $pf . "configuration` (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES('Enable Google+ Share Icon', 'PRODUCT_INFO_SOCIAL_SHARE_GOOGLE', 1, 'Allow people to share with Google+', 23, 2, now(), now(), 'lc_cfg_use_get_boolean_value', 'lc_cfg_set_boolean_value(array(1, -1))');");
     }
     if (!defined('PRODUCT_INFO_SOCIAL_SHARE_PIN')) {
         $lC_Database->simpleQuery("INSERT IGNORE INTO `" . $pf . "configuration` (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES('Enable Pinterest Share Icon', 'PRODUCT_INFO_SOCIAL_SHARE_PIN', 1, 'Allow people to share with Pinterest', 23, 3, now(), now(), 'lc_cfg_use_get_boolean_value', 'lc_cfg_set_boolean_value(array(1, -1))');");
         parent::log("Database Update: INSERT INTO `" . $pf . "configuration` (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES('Enable Pinterest Share Icon', 'PRODUCT_INFO_SOCIAL_SHARE_PIN', 1, 'Allow people to share with Pinterest', 23, 3, now(), now(), 'lc_cfg_use_get_boolean_value', 'lc_cfg_set_boolean_value(array(1, -1))');");
     }
     if (!defined('PRODUCT_INFO_SOCIAL_SHARE_LINKED')) {
         $lC_Database->simpleQuery("INSERT IGNORE INTO `" . $pf . "configuration` (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES('Enable LinkedIn Share Icon', 'PRODUCT_INFO_SOCIAL_SHARE_LINKED', -1, 'Allow people to share with LinkedIn', 23, 4, now(), now(), 'lc_cfg_use_get_boolean_value', 'lc_cfg_set_boolean_value(array(1, -1))');");
         parent::log("Database Update: INSERT INTO `" . $pf . "configuration` (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES('Enable LinkedIn Share Icon', 'PRODUCT_INFO_SOCIAL_SHARE_LINKED', -1, 'Allow people to share with LinkedIn', 23, 4, now(), now(), 'lc_cfg_use_get_boolean_value', 'lc_cfg_set_boolean_value(array(1, -1))');");
     }
     if (!defined('PRODUCT_INFO_SOCIAL_SHARE_TUMBLR')) {
         $lC_Database->simpleQuery("INSERT IGNORE INTO `" . $pf . "configuration` (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES('Enable Tumblr Share Icon', 'PRODUCT_INFO_SOCIAL_SHARE_TUMBLR', 1, 'Allow people to share with Tumblr', 23, 5, now(), now(), 'lc_cfg_use_get_boolean_value', 'lc_cfg_set_boolean_value(array(1, -1))');");
         parent::log("Database Update: INSERT INTO `" . $pf . "configuration` (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES('Enable Tumblr Share Icon', 'PRODUCT_INFO_SOCIAL_SHARE_TUMBLR', 1, 'Allow people to share with Tumblr', 23, 5, now(), now(), 'lc_cfg_use_get_boolean_value', 'lc_cfg_set_boolean_value(array(1, -1))');");
     }
     if (!defined('PRODUCT_MODULES_FILE_UPLOAD_MAX_SIZE')) {
         $lC_Database->simpleQuery("INSERT INTO `" . $pf . "configuration` (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES('Maximum Upload File Size', 'PRODUCT_MODULES_FILE_UPLOAD_MAX_SIZE', '10', 'Enter the maximum size allowed for file uploads.', 22, 0, now(), now(), NULL, NULL)");
         parent::log("Database Update: INSERT INTO `" . $pf . "configuration` (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES('Maximum Upload File Size', 'PRODUCT_MODULES_FILE_UPLOAD_MAX_SIZE', '10', 'Enter the maximum size (in MB) allowed for file uploads.', 22, 0, now(), now(), NULL, NULL)");
     }
     if (!defined('B2B_SETTINGS_ALLOW_SELF_REGISTER')) {
         $lC_Database->simpleQuery("insert into `" . $pf . "configuration` (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('', 'B2B_SETTINGS_ALLOW_SELF_REGISTER', '1', '', '6', '0', '', '', now())");
         parent::log("Database Update: insert into `" . $pf . "configuration` (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('', 'B2B_SETTINGS_ALLOW_SELF_REGISTER', '1', '', '6', '0', '', '', now())");
     }
     if (!defined('B2B_SETTINGS_GUEST_CATALOG_ACCESS')) {
         $lC_Database->simpleQuery("insert into `" . $pf . "configuration` (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('', 'B2B_SETTINGS_GUEST_CATALOG_ACCESS', '4', '', '6', '0', '', '', now())");
         parent::log("Database Update: insert into `" . $pf . "configuration` (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('', 'B2B_SETTINGS_GUEST_CATALOG_ACCESS', '4', '', '6', '0', '', '', now())");
     }
     $lC_Database->simpleQuery("CREATE TABLE IF NOT EXISTS `" . $pf . "purchase_orders_service` (`po_number_id` int(11) NOT NULL AUTO_INCREMENT, `po_number` varchar(255) NOT NULL, `orders_id` int(11) NOT NULL, `po_number_status` int(1) NOT NULL DEFAULT '1', PRIMARY KEY (`po_number_id`)) ENGINE=" . $engine . " CHARACTER SET utf8 COLLATE utf8_general_ci");
     parent::log("Database Update: CREATE TABLE IF NOT EXISTS `" . $pf . "purchase_orders_service` (`po_number_id` int(11) NOT NULL AUTO_INCREMENT, `po_number` varchar(255) NOT NULL, `orders_id` int(11) NOT NULL, `po_number_status` int(1) NOT NULL DEFAULT '1', PRIMARY KEY (`po_number_id`)) ENGINE=" . $engine . " CHARACTER SET utf8 COLLATE utf8_general_ci");
     $lC_Database->simpleQuery("ALTER IGNORE TABLE `" . $pf . "products_pricing` ADD `group_status` INT(11) NOT NULL DEFAULT '-1'");
     parent::log("Database Update: ALTER IGNORE TABLE `" . $pf . "products_pricing` ADD `group_status` INT(11) NOT NULL DEFAULT '-1'");
     $lC_Database->simpleQuery("ALTER IGNORE TABLE `" . $pf . "products_pricing` ADD `group_price` DECIMAL(15,4) NOT NULL DEFAULT '0.0000'");
     parent::log("Database Update: ALTER IGNORE TABLE `" . $pf . "products_pricing` ADD `group_price` DECIMAL(15,4) NOT NULL DEFAULT '0.0000'");
     $lC_Database->simpleQuery("ALTER IGNORE TABLE `" . $pf . "products_pricing` ADD `special_status` TINYINT(1) NOT NULL DEFAULT '-1'");
     parent::log("Database Update: ALTER IGNORE TABLE `" . $pf . "products_pricing` ADD `special_status` TINYINT(1) NOT NULL DEFAULT '-1'");
     $lC_Database->simpleQuery("ALTER IGNORE TABLE `" . $pf . "products_pricing` ADD `special_price` DECIMAL(15,4) NOT NULL DEFAULT '0.0000'");
     parent::log("Database Update: ALTER IGNORE TABLE `" . $pf . "products_pricing` ADD `special_price` DECIMAL(15,4) NOT NULL DEFAULT '0.0000'");
     $lC_Database->simpleQuery("ALTER IGNORE TABLE `" . $pf . "products_pricing` ADD `special_start` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00'");
     parent::log("Database Update: ALTER IGNORE TABLE `" . $pf . "products_pricing` ADD `special_start` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00'");
     $lC_Database->simpleQuery("ALTER IGNORE TABLE `" . $pf . "products_pricing` ADD `special_end` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00'");
     parent::log("Database Update: ALTER IGNORE TABLE `" . $pf . "products_pricing` ADD `special_end` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00'");
     $lC_Database->simpleQuery("ALTER IGNORE TABLE `" . $pf . "products_pricing` CHANGE `qty_break` INT(11) NOT NULL DEFAULT '-1'");
     parent::log("Database Update: ALTER IGNORE TABLE `" . $pf . "products_pricing` CHANGE `qty_break` INT(11) NOT NULL DEFAULT '-1'");
     $lC_Database->simpleQuery("ALTER IGNORE TABLE `" . $pf . "products` ADD `groups_pricing_enable` TINYINT(1) NOT NULL DEFAULT '0'");
     parent::log("Database Update: ALTER IGNORE TABLE `" . $pf . "products` ADD `groups_pricing_enable` TINYINT(1) NOT NULL DEFAULT '0'");
     $lC_Database->simpleQuery("ALTER IGNORE TABLE `" . $pf . "products` ADD `qpb_pricing_enable` TINYINT(1) NOT NULL DEFAULT '0'");
     parent::log("Database Update: ALTER IGNORE TABLE `" . $pf . "products` ADD `qpb_pricing_enable` TINYINT(1) NOT NULL DEFAULT '0'");
     $lC_Database->simpleQuery("ALTER IGNORE TABLE `" . $pf . "products` ADD `specials_pricing_enable` TINYINT(1) NOT NULL DEFAULT '0'");
     parent::log("Database Update: ALTER IGNORE TABLE `" . $pf . "products` ADD `specials_pricing_enable` TINYINT(1) NOT NULL DEFAULT '0'");
     $lC_Database->simpleQuery("ALTER IGNORE TABLE `" . $pf . "products_pricing` ADD `parent_id` TINYINT(1) NOT NULL DEFAULT '0' AFTER `products_id`");
     parent::log("Database Update: ALTER IGNORE TABLE `" . $pf . "products_pricing` ADD `parent_id` TINYINT(1) NOT NULL DEFAULT '0' AFTER `products_id`");
     $lC_Database->simpleQuery("ALTER IGNORE TABLE `" . $pf . "products_description` ADD `products_blurb` VARCHAR(4096) NOT NULL DEFAULT '' AFTER `products_name`");
     parent::log("Database Update: ALTER IGNORE TABLE `" . $pf . "products_description` ADD `products_blurb` VARCHAR(4096) NOT NULL DEFAULT '' AFTER `products_name`");
     $lC_Database->simpleQuery("CREATE TABLE IF NOT EXISTS `" . $pf . "payment_terms` (id int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) NOT NULL DEFAULT '', breakout varchar(255) NOT NULL DEFAULT '', threshold decimal(15,4) NOT NULL DEFAULT '0.0000', sort_order int(11) NOT NULL DEFAULT '0', `status` tinyint(1) NOT NULL DEFAULT '0', date_added datetime NOT NULL DEFAULT '0000-00-00 00:00:00', last_modified datetime NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (id)) ENGINE=" . $engine . " CHARACTER SET utf8 COLLATE utf8_general_ci;");
     parent::log("Database Update: CREATE TABLE IF NOT EXISTS `" . $pf . "payment_terms` (id int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) NOT NULL DEFAULT '', breakout varchar(255) NOT NULL DEFAULT '', threshold decimal(15,4) NOT NULL DEFAULT '0.0000', sort_order int(11) NOT NULL DEFAULT '0', `status` tinyint(1) NOT NULL DEFAULT '0', date_added datetime NOT NULL DEFAULT '0000-00-00 00:00:00', last_modified datetime NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (id)) ENGINE=" . $engine . " CHARACTER SET utf8 COLLATE utf8_general_ci;");
     $lC_Database->simpleQuery("ALTER IGNORE TABLE `" . $pf . "customers_groups_data` ADD `payment_terms` VARCHAR(255) NOT NULL DEFAULT '' AFTER `customers_access_levels`");
     parent::log("Database Update: ALTER IGNORE TABLE `" . $pf . "customers_groups_data` ADD `payment_terms` VARCHAR(255) NOT NULL DEFAULT '' AFTER `customers_access_levels`");
     $lC_Database->simpleQuery("ALTER IGNORE TABLE `" . $pf . "branding_data` CHANGE `support_phone` `support_phone` VARCHAR(128) NOT NULL DEFAULT '', CHANGE `sales_phone` `sales_phone` VARCHAR(128) NOT NULL DEFAULT ''");
     parent::log("Database Update: ALTER IGNORE TABLE `" . $pf . "branding_data` CHANGE `support_phone` `support_phone` VARCHAR(128) NOT NULL DEFAULT '', CHANGE `sales_phone` `sales_phone` VARCHAR(128) NOT NULL DEFAULT ''");
     $lC_Database->simpleQuery("ALTER IGNORE TABLE `" . $pf . "product_attributes` ADD `value2` TEXT NOT NULL AFTER `value`");
     parent::log("Database Update: ALTER IGNORE TABLE `" . $pf . "product_attributes` ADD `value2` TEXT NOT NULL AFTER `value`");
     $lC_Database->simpleQuery("CREATE TABLE IF NOT EXISTS `" . $pf . "localization` (id int(11) NOT NULL AUTO_INCREMENT, domain varchar(255) NOT NULL, alt_domain tinyint(1) NOT NULL DEFAULT '0', currencies_id int(11) NOT NULL DEFAULT '0', language_id int(11) NOT NULL DEFAULT '0', show_tax tinyint(1) NOT NULL DEFAULT '0', default_tax_zone int(11) NOT NULL DEFAULT '0', base_price_modifier decimal(15,4) NOT NULL DEFAULT '0', `status` tinyint(1) NOT NULL DEFAULT '1', id int(11) NOT NULL AUTO_INCREMENT, domain varchar(255) NOT NULL, alt_domain tinyint(1) NOT NULL DEFAULT '0', currencies_id int(11) NOT NULL, language_id int(11) NOT NULL, show_tax tinyint(1) NOT NULL, default_tax_zone int(11) NOT NULL, base_price_modifier decimal(15,4) NOT NULL DEFAULT '0', `status` tinyint(1) NOT NULL DEFAULT '1', PRIMARY KEY (id)) ENGINE=" . $engine . " CHARACTER SET utf8 COLLATE utf8_general_ci;");
     parent::log("Database Update: CREATE TABLE IF NOT EXISTS `" . $pf . "localization` (id int(11) NOT NULL AUTO_INCREMENT, domain varchar(255) NOT NULL, alt_domain tinyint(1) NOT NULL DEFAULT '0', currencies_id int(11) NOT NULL DEFAULT '0', language_id int(11) NOT NULL DEFAULT '0', show_tax tinyint(1) NOT NULL DEFAULT '0', default_tax_zone int(11) NOT NULL DEFAULT '0', base_price_modifier decimal(15,4) NOT NULL DEFAULT '0', `status` tinyint(1) NOT NULL DEFAULT '1', id int(11) NOT NULL AUTO_INCREMENT, domain varchar(255) NOT NULL, alt_domain tinyint(1) NOT NULL DEFAULT '0', currencies_id int(11) NOT NULL, language_id int(11) NOT NULL, show_tax tinyint(1) NOT NULL, default_tax_zone int(11) NOT NULL, base_price_modifier decimal(15,4) NOT NULL DEFAULT '0', `status` tinyint(1) NOT NULL DEFAULT '1', PRIMARY KEY (id)) ENGINE=" . $engine . " CHARACTER SET utf8 COLLATE utf8_general_ci;");
     $lC_Database->simpleQuery("CREATE TABLE IF NOT EXISTS `" . $pf . "customers_access` (  id int(11) NOT NULL AUTO_INCREMENT, `level` varchar(128) NOT NULL, `status` tinyint(1) NOT NULL, PRIMARY KEY (id)) ENGINE=" . $engine . " CHARACTER SET utf8 COLLATE utf8_general_ci;");
     parent::log("Database Update: CREATE TABLE IF NOT EXISTS `" . $pf . "customers_access` (  id int(11) NOT NULL AUTO_INCREMENT, `level` varchar(128) NOT NULL, `status` tinyint(1) NOT NULL, PRIMARY KEY (id)) ENGINE=" . $engine . " CHARACTER SET utf8 COLLATE utf8_general_ci;");
     $Qchk = $lC_Database->query('select * from :table_customers_access")');
     $Qchk->bindTable(':table_customers_access', $pf . "customers_access");
     $Qchk->execute();
     if ($Qchk->numberOfRows() == 0) {
         $lC_Database->simpleQuery("INSERT INTO `" . $pf . "customers_access` (id, level, status) VALUES (1, 'Guest', '1')");
         parent::log("Database Update: INSERT INTO `" . $pf . "customers_access` (id, level, status) VALUES (1, 'Guest', '1')");
         $lC_Database->simpleQuery("INSERT INTO `" . $pf . "customers_access` (id, level, status) VALUES (2, 'Registered', '1')");
         parent::log("Database Update: INSERT INTO `" . $pf . "customers_access` (id, level, status) VALUES (2, 'Registered', '1')");
     }
     if (!defined('PRODUCT_LISTING_DISPLAY_ORDER')) {
         $lC_Database->simpleQuery("INSERT INTO `" . $pf . "configuration` (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES('Products Display Order', 'PRODUCT_LISTING_DISPLAY_ORDER', 'Name', 'Products displayed on listing pages are ordered by this value.', 8, 0, now(), now(), null, 'lc_cfg_set_boolean_value(array(''Name'', ''Model'', ''Price'', ''Manufacturer'', ''Quantity'', ''Weight'', ''Last Added'', ''Sort Order''))');");
         parent::log("Database Update: INSERT INTO `" . $pf . "configuration` (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES('Products Display Order', 'PRODUCT_LISTING_DISPLAY_ORDER', 'Name', 'Products displayed on listing pages are ordered by this value.', 8, 0, now(), now(), null, 'lc_cfg_set_boolean_value(array(''Name'', ''Model'', ''Price'', ''Manufacturer'', ''Quantity'', ''Weight'', ''Last Added'', ''Sort Order''))');");
     }
     $lC_Database->simpleQuery("ALTER TABLE `" . $pf . "products` ADD `products_sort_order` int(11) NOT NULL DEFAULT '0'");
     parent::log("Database Update: ALTER TABLE `" . $pf . "products` ADD `products_sort_order` int(11) NOT NULL DEFAULT '0'");
 }
Ejemplo n.º 2
0
                      }
                    }
                  });
            $(api);
          }
        }
      );
    }    
    apiHealthCheck();
    
    var title = '<?php 
echo lc_link_object(lc_href_link_admin(FILENAME_DEFAULT, 'updates'), $lC_Language->get('update_message_title'), 'style="color:white;"');
?>
';
    var uData = <?php 
echo json_encode(lC_Updates_Admin::hasUpdatesAvailable());
?>
;
    if (uData.hasUpdates) {
      notify(title, '<?php 
echo $lC_Language->get('update_message_text1');
?>
 ' + uData.toVersion + ' <?php 
echo $lC_Language->get('update_message_text2');
?>
', {
        icon: 'templates/default/img/smiley.png',
        showCloseOnHover: false
      });    
    }
  }
Ejemplo n.º 3
0
function __writeHistory(ua, ur) {
  var jsonLink = '<?php 
echo lc_href_link_admin('rpc.php', $lC_Template->getModule() . '&action=writeHistory&ua=ACTION&ur=RESULT');
?>
'
  $.getJSON(jsonLink.replace('ACTION', ua).replace('RESULT', ur),
    function (data) {
      return true;
    }
  );  
}

function __showUpdateModal() {
  var msgBodyArr = <?php 
echo json_encode(lC_Updates_Admin::getAvailablePackageInfo());
?>
;
  var requestType = '<?php 
echo isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on' ? 'https' : 'http';
?>
';
  var url = (msgBodyArr.announcement != undefined) ? msgBodyArr.announcement : requestType + '://api.loadedcommerce.com/messages/updates/default.html';
  $.modal({                                 
      url: 'iframe.php?url=' + url,
      useIframe: true,
      title: '<?php 
echo $lC_Language->get('modal_heading_update_msg');
?>
',
      width: 550,
Ejemplo n.º 4
0
 public static function verifyProductsAreDownloaded($products)
 {
     $productsArr = explode('|', $products);
     $cnt = 0;
     foreach ($productsArr as $key => $product) {
         $parts = explode(':', $product);
         $type = $parts[0];
         $item = $parts[1];
         if ($type == 'template') {
             if (!file_exists(DIR_FS_ADMIN . 'includes/templates/' . $item . '.php')) {
                 // get the template phar and apply it
             }
         } else {
             // addon
             if (!file_exists(DIR_FS_CATALOG . 'addons/' . $item . '/controller.php')) {
                 // download the addon phar
                 lC_Store_Admin::getAddonPhar($item);
                 // apply the phar package
                 if (file_exists(DIR_FS_WORK . 'addons/' . $item . '.phar')) {
                     lC_Updates_Admin::applyPackage(DIR_FS_WORK . 'addons/' . $item . '.phar');
                 }
             }
         }
         $cnt++;
     }
 }
Ejemplo n.º 5
0
 /**
  * Apply the update
  *  
  * @access public      
  * @return boolean
  */
 public static function applyPackage($pharWithPath = null, $pharType = 'addon')
 {
     $phar_can_open = true;
     $meta = array();
     $pro_hart = array();
     try {
         if ($pharWithPath == null) {
             $pharFile = 'update.phar';
             $phar = new Phar(DIR_FS_WORK . 'updates/' . $pharFile);
             $meta = $phar->getMetadata();
             self::$_to_version = $meta['version_to'];
             // reset the log
             if (file_exists(DIR_FS_WORK . 'logs/update-' . self::$_to_version . '.txt') && is_writable(DIR_FS_WORK . 'logs/update-' . self::$_to_version . '.txt')) {
                 unlink(DIR_FS_WORK . 'logs/update-' . self::$_to_version . '.txt');
             }
             $pharCode = 'update';
             if (defined('ADDONS_SYSTEM_LOADED_7_PRO_STATUS') && is_dir(DIR_FS_CATALOG . 'addons/Loaded_7_Pro')) {
                 self::rmdir_r(DIR_FS_CATALOG . 'addons/Loaded_7_Pro');
             }
             if (defined('ADDONS_SYSTEM_LOADED_7_B2B_STATUS') && is_dir(DIR_FS_CATALOG . 'addons/Loaded_7_B2B')) {
                 self::rmdir_r(DIR_FS_CATALOG . 'addons/Loaded_7_B2B');
             }
             self::log('##### UPDATE TO ' . self::$_to_version . ' STARTED', $pharCode);
         } else {
             $pharFile = end(explode('/', $pharWithPath));
             $phar = new Phar(DIR_FS_WORK . 'addons/' . $pharFile);
             $meta = $phar->getMetadata();
             $pharCode = str_replace('.phar', '', $pharFile);
             if ($meta['type'] != '') {
                 $pharType = $meta['type'];
             }
             // reset the log
             if (file_exists(DIR_FS_WORK . 'logs/addon-' . $pharCode . '.txt') && is_writable(DIR_FS_WORK . 'logs/addon-' . $pharCode . '.txt')) {
                 unlink(DIR_FS_WORK . 'logs/addon-' . $pharCode . '.txt');
             }
             self::log('##### ADDON INSTALL ' . $pharCode . ' STARTED', $pharCode);
         }
         // first delete files before extracting new files
         if (is_array($meta['delete']) && count($meta['delete']) > 0) {
             foreach ($meta['delete'] as $file) {
                 $directory = realpath(DIR_FS_CATALOG) . '/';
                 if (file_exists($directory . $file)) {
                     if (is_dir($directory . $file)) {
                         if (rename($directory . $file, $directory . dirname($file) . '/.CU_' . basename($file))) {
                             $pro_hart[] = array('type' => 'directory', 'where' => $directory, 'path' => dirname($file) . '/.CU_' . basename($file), 'log' => true);
                         }
                     } else {
                         if (rename($directory . $file, $directory . dirname($file) . '/.CU_' . basename($file))) {
                             $pro_hart[] = array('type' => 'file', 'where' => $directory, 'path' => dirname($file) . '/.CU_' . basename($file), 'log' => true);
                         }
                     }
                 }
             }
         }
         // loop through each file individually as extractTo() does not work with
         // directories (see http://bugs.php.net/bug.php?id=54289)
         foreach (new RecursiveIteratorIterator($phar) as $iteration) {
             if (($pos = strpos($iteration->getPathName(), '.phar')) !== false) {
                 $file = substr($iteration->getPathName(), $pos + 6);
                 if (version_compare($meta['compatibility'], '7.002.0.0') != -1 || $pharType == 'template' || $pharType == 'language' || $pharWithPath == null) {
                     $directory = realpath(DIR_FS_CATALOG) . '/';
                 } else {
                     $directory = realpath(DIR_FS_CATALOG) . '/addons/' . $pharCode . '/';
                 }
                 if (file_exists($directory . $file)) {
                     if (rename($directory . $file, $directory . dirname($file) . '/.CU_' . basename($file))) {
                         $pro_hart[] = array('type' => 'file', 'where' => $directory, 'path' => dirname($file) . '/.CU_' . basename($file), 'log' => false);
                     }
                 }
                 if ($phar->extractTo($directory, $file, true)) {
                     self::log('Extracted: ' . $file, $pharCode);
                 } else {
                     self::log('*** Could Not Extract: ' . $file, $pharCode);
                 }
             }
         }
         self::log('##### CLEANUP', $pharCode);
         foreach (array_reverse($pro_hart, true) as $mess) {
             if ($mess['type'] == 'directory') {
                 if (self::rmdir_r($mess['where'] . $mess['path'])) {
                     if ($mess['log'] === true) {
                         self::log('Deleted: ' . str_replace('/.CU_', '/', $mess['path']), $pharCode);
                     }
                 } else {
                     if ($mess['log'] === true) {
                         self::log('*** Could Not Delete: ' . str_replace('/.CU_', '/', $mess['path']), $pharCode);
                     }
                 }
             } else {
                 if (unlink($mess['where'] . $mess['path'])) {
                     if ($mess['log'] === true) {
                         self::log('Deleted: ' . str_replace('/.CU_', '/', $mess['path']), $pharCode);
                     }
                 } else {
                     if ($mess['log'] === true) {
                         self::log('*** Could Not Delete: ' . str_replace('/.CU_', '/', $mess['path']), $pharCode);
                     }
                 }
             }
         }
     } catch (Exception $e) {
         $phar_can_open = false;
         self::log('##### ERROR: ' . $e->getMessage(), $pharCode);
         self::log('##### REVERTING STARTED', $pharCode);
         foreach (array_reverse($pro_hart, true) as $mess) {
             if ($mess['type'] == 'directory') {
                 if (file_exists($mess['where'] . str_replace('/.CU_', '/', $mess['path']))) {
                     self::rmdir_r($mess['where'] . str_replace('/.CU_', '/', $mess['path']));
                 }
             } else {
                 if (file_exists($mess['where'] . str_replace('/.CU_', '/', $mess['path']))) {
                     unlink($mess['where'] . str_replace('/.CU_', '/', $mess['path']));
                 }
             }
             if (file_exists($mess['where'] . $mess['path'])) {
                 rename($mess['where'] . $mess['path'], $mess['where'] . str_replace('/.CU_', '/', $mess['path']));
             }
             self::log('Reverted: ' . str_replace('/.CU_', '/', $mess['path']), $pharCode);
         }
         self::log('##### REVERTING COMPLETE', $pharCode);
         self::log('##### UPDATE TO ' . self::$_to_version . ' FAILED', $pharCode);
         trigger_error($e->getMessage());
         trigger_error('Please review the update log at: ' . DIR_FS_WORK . 'logs/update-' . self::$_to_version . '.txt');
     }
     if ($pharWithPath == null) {
         // execute run after process
         self::doRunAfter();
         // verify 644 permissions on PHP files on Linux systems
         if (utility::execEnabled() === true && utility::isLinux() === true) {
             try {
                 exec('\\find ' . DIR_FS_CATALOG . ' \\( -type f -exec chmod 644 {} \\; \\);');
                 self::log('##### UPDATED Permissions on PHP files/directories', $pharCode);
             } catch (Exception $e) {
                 self::log('*** Could NOT Set Permissions on PHP files/directories', $pharCode);
             }
             self::log('##### UPDATE TO ' . self::$_to_version . ' COMPLETE', $pharCode);
         } else {
             try {
                 self::chmod_r(DIR_FS_CATALOG);
                 self::log('##### UPDATED Permissions on PHP files/directories', $pharCode);
             } catch (Exception $e) {
                 self::log('*** Could NOT Set Permissions on PHP files/directories', $pharCode);
             }
             // remove the update phar
             if (file_exists(DIR_FS_WORK . 'updates/update.phar')) {
                 unlink(DIR_FS_WORK . 'updates/update.phar');
             }
             self::log('##### UPDATE TO ' . self::$_to_version . ' COMPLETE', $pharCode);
         }
     } else {
         // remove the addon phar & pubkey
         if (file_exists(DIR_FS_WORK . 'addons/' . $pharCode . '.phar')) {
             unlink(DIR_FS_WORK . 'addons/' . $pharCode . '.phar');
         }
         if (file_exists(DIR_FS_WORK . 'addons/' . $pharCode . '.phar.pubkey')) {
             unlink(DIR_FS_WORK . 'addons/' . $pharCode . '.phar.pubkey');
         }
         self::log('##### ADDON INSTALL ' . $code . ' COMPLETE', $pharCode);
     }
     return $phar_can_open;
 }
Ejemplo n.º 6
0
<?php

/**
  @package    catalog::admin::applications
  @author     Loaded Commerce
  @copyright  Copyright 2003-2014 Loaded Commerce, LLC
  @copyright  Portions Copyright 2003 osCommerce
  @copyright  Template built on Developr theme by DisplayInline http://themeforest.net/user/displayinline under Extended license 
  @license    https://github.com/loadedcommerce/loaded7/blob/master/LICENSE.txt
  @version    $Id: main.php v1.0 2013-08-08 datazen $
*/
$checkArr = lC_Updates_Admin::hasUpdatesAvailable();
$backupArr = lC_Updates_Admin::getBackups();
?>
<!-- Main content -->
<section role="main" id="main">
  <noscript class="message black-gradient simpler"><?php 
echo $lC_Language->get('ms_error_javascript_not_enabled_warning');
?>
</noscript>
  <hgroup id="main-title" class="thin small-margin-bottom">
    <h1><?php 
echo $lC_Template->getPageTitle();
?>
</h1>
  </hgroup>
  <style>
  #versionContainer .fieldset { padding-bottom:1px; }
  #versionContainer .legend { font-weight:bold; font-size: 1.1em; }
  #versionContainer .update-text { text-align:center; }
  #versionContainer .cancel-text { text-align:center; margin-top:20px; font-size:.9em; }
Ejemplo n.º 7
0
 public static function install($key)
 {
     global $lC_Database, $lC_Language, $lC_Vqmod, $lC_Addons;
     $isTemplate = strstr($key, 'lC_Template_') ? true : false;
     if ($isTemplate) {
         $key = str_replace('lC_Template_', '', $key);
         if (!file_exists(DIR_FS_ADMIN . 'includes/templates/' . $key . '.php')) {
             // get the addon phar from the store
             self::getAddonPhar($key, 'template');
             // apply the addon phar
             if (file_exists(DIR_FS_WORK . 'addons/' . $key . '.phar')) {
                 lC_Updates_Admin::applyPackage(DIR_FS_WORK . 'addons/' . $key . '.phar', 'template');
             }
         }
         self::_resetAddons();
         return true;
     } else {
         // is addon or language
         if (!file_exists(DIR_FS_CATALOG . 'addons/' . $key . '/controller.php')) {
             // get the addon phar from the store
             self::getAddonPhar($key);
             $phar = new Phar(DIR_FS_WORK . 'addons/' . $key . '.phar', 0);
             $meta = $phar->getMetadata();
             // apply the addon phar
             if (file_exists(DIR_FS_WORK . 'addons/' . $key . '.phar')) {
                 lC_Updates_Admin::applyPackage(DIR_FS_WORK . 'addons/' . $key . '.phar');
             }
             if ($meta['type'] == 'language') {
                 return true;
             }
         }
         // sanity check to see if the object is already installed
         $okToInstall = true;
         $Qchk = $lC_Database->query("select id from :table_templates_boxes where modules_group LIKE '%" . $key . "%'");
         $Qchk->bindTable(':table_templates_boxes', TABLE_TEMPLATES_BOXES);
         $Qchk->execute();
         if ($Qchk->numberOfRows() > 0) {
             $okToInstall = false;
         }
         $Qchk->freeResult();
         if (file_exists(DIR_FS_CATALOG . 'addons/' . $key . '/controller.php') && $okToInstall === true) {
             include_once DIR_FS_CATALOG . 'addons/' . $key . '/controller.php';
             $addon = $key;
             $addon = new $addon();
             $modules_group = $addon->getAddonType() . '|' . $key;
             $addon->install();
             $code = $addon->getAddonType();
             $title = $addon->getAddonTitle();
             // check for payment or shipping modules and adjust addon $code to module $code
             if (is_dir(DIR_FS_CATALOG . 'addons/' . $addon->getAddonCode() . '/modules/payment/')) {
                 $lC_DirectoryListing = new lC_DirectoryListing(DIR_FS_CATALOG . 'addons/' . $addon->getAddonCode() . '/modules/payment/');
                 $lC_DirectoryListing->setCheckExtension('php');
                 foreach ($lC_DirectoryListing->getFiles() as $ao) {
                     if (isset($ao['name'])) {
                         $code = substr($ao['name'], 0, strpos($ao['name'], '.'));
                         $title = str_replace('_', ' ', $key);
                         $modules_group = 'payment|' . $key;
                         break;
                     }
                 }
             } else {
                 if (is_dir(DIR_FS_CATALOG . 'addons/' . $addon->getAddonCode() . '/modules/shipping/')) {
                     $lC_DirectoryListing = new lC_DirectoryListing(DIR_FS_CATALOG . 'addons/' . $addon->getAddonCode() . '/modules/shipping/');
                     $lC_DirectoryListing->setCheckExtension('php');
                     foreach ($lC_DirectoryListing->getFiles() as $ao) {
                         if (isset($ao['name'])) {
                             $code = substr($ao['name'], 0, strpos($ao['name'], '.'));
                             $title = str_replace('_', ' ', $key);
                             $modules_group = 'shipping|' . $key;
                             break;
                         }
                     }
                 }
             }
             if (empty($code) === false) {
                 $Qdel = $lC_Database->query('delete from :table_templates_boxes where modules_group = :modules_group');
                 $Qdel->bindTable(':table_templates_boxes', TABLE_TEMPLATES_BOXES);
                 $Qdel->bindValue(':modules_group', $modules_group);
                 $Qdel->execute();
                 $Qinstall = $lC_Database->query('insert into :table_templates_boxes (title, code, author_name, author_www, modules_group) values (:title, :code, :author_name, :author_www, :modules_group)');
                 $Qinstall->bindTable(':table_templates_boxes', TABLE_TEMPLATES_BOXES);
                 $Qinstall->bindValue(':title', $title);
                 $Qinstall->bindValue(':code', $code);
                 $Qinstall->bindValue(':author_name', $addon->getAddonAuthor());
                 $Qinstall->bindValue(':author_www', $addon->getAddonAuthorWWW());
                 $Qinstall->bindValue(':modules_group', $modules_group);
                 $Qinstall->execute();
                 self::_resetAddons();
                 return true;
             }
         }
     }
     return false;
 }
Ejemplo n.º 8
0
 public static function updateDatabase()
 {
     $result = array();
     if (lC_Updates_Admin::doRunAfter()) {
         $result['rpcStatus'] = RPC_STATUS_SUCCESS;
     }
     echo json_encode($result);
 }