* @copyright 2018 Sakis Gkiokas * @license https://opensource.org/licenses/GPL-3.0 GNU General Public License version 3 */ if (!defined('_PS_VERSION_')) { exit; } function upgrade_module_1_0_4($object) { $ret = true; $ret &= Configuration::updateValue('PS_CODWFEEPLUS_BEHAVIOUR', 0); $ret &= Configuration::updateValue('PS_CODWFEEPLUS_KEEPTRANSACTIONS', 1); $ret &= Db::getInstance()->execute(' ALTER TABLE `' ._DB_PREFIX_.'codwfeeplus_conditions` ADD `codwfeeplus_cartvalue` DECIMAL(13, 4) NOT NULL DEFAULT \'0\' AFTER `codwfeeplus_desc`, ADD `codwfeeplus_cartvalue_sign` int(2) unsigned NOT NULL DEFAULT \'0\' AFTER `codwfeeplus_desc` '); $ret &= Db::getInstance()->execute(' CREATE TABLE IF NOT EXISTS `' ._DB_PREFIX_.'codwfeeplus_transactions` ( `id_codwfeeplus_trans` int(10) unsigned NOT NULL AUTO_INCREMENT, `codwfeeplus_result` TEXT, `codwfeeplus_datetime` DATETIME NOT NULL, `codwfeeplus_customer_id` int(10) NOT NULL DEFAULT \'0\', `codwfeeplus_order_id` int(10) NOT NULL DEFAULT \'0\', `codwfeeplus_fee` DECIMAL(13, 4) NOT NULL DEFAULT \'0\', `codwfeeplus_cart_total` DECIMAL(13, 4) NOT NULL DEFAULT \'0\', PRIMARY KEY (`id_codwfeeplus_trans`) ) ENGINE=' ._MYSQL_ENGINE_.' DEFAULT CHARSET=UTF8; '); return $ret; }