* @copyright 2022 idnovate.com * @license See above */ function upgrade_module_1_1_18() { $columnExists = Db::getInstance()->getRow( "SELECT * FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = '"._DB_NAME_."' AND TABLE_NAME = '"._DB_PREFIX_."advancedpopup' AND COLUMN_NAME = 'product_stock'" ); if (!$columnExists) { $query = "ALTER TABLE `" . _DB_PREFIX_ . "advancedpopup` ADD `product_stock` tinyint(1) NOT NULL AFTER `display_ip_string`, ADD `product_stock_from` INT(10) NULL AFTER `product_stock`, ADD `product_stock_to` INT(10) NULL AFTER `product_stock_from`;"; Db::getInstance()->execute($query); $query = "UPDATE `" . _DB_PREFIX_ . "advancedpopup` SET product_stock = 0;"; Db::getInstance()->execute($query); } return true; }