first commit
This commit is contained in:
30
modules/codwfeeplus/upgrade/index.php
Normal file
30
modules/codwfeeplus/upgrade/index.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
/** Copyright 2018 Sakis Gkiokas
|
||||
* This file is part of codwfeeplus module for Prestashop.
|
||||
*
|
||||
* Codwfeeplus is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Codwfeeplus is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* For any recommendations and/or suggestions please contact me
|
||||
* at sakgiok@gmail.com
|
||||
*
|
||||
* @author Sakis Gkiokas <sakgiok@gmail.com>
|
||||
* @copyright 2018 Sakis Gkiokas
|
||||
* @license https://opensource.org/licenses/GPL-3.0 GNU General Public License version 3
|
||||
*/
|
||||
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
|
||||
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
|
||||
|
||||
header('Cache-Control: no-store, no-cache, must-revalidate');
|
||||
header('Cache-Control: post-check=0, pre-check=0', false);
|
||||
header('Pragma: no-cache');
|
||||
|
||||
header('Location: ../');
|
||||
exit;
|
||||
38
modules/codwfeeplus/upgrade/install-1.0.3.php
Normal file
38
modules/codwfeeplus/upgrade/install-1.0.3.php
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
/** Copyright 2018 Sakis Gkiokas
|
||||
* This file is part of codwfeeplus module for Prestashop.
|
||||
*
|
||||
* Codwfeeplus is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Codwfeeplus is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* For any recomendations and/or suggestions please contact me
|
||||
* at sakgiok@gmail.com
|
||||
*
|
||||
* @author Sakis Gkiokas <sakgiok@gmail.com>
|
||||
* @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_3($object)
|
||||
{
|
||||
$ret = Db::getInstance()->execute('
|
||||
ALTER TABLE `' ._DB_PREFIX_.'codwfeeplus_conditions`
|
||||
ADD `codwfeeplus_categories` TEXT NULL AFTER `codwfeeplus_zones`
|
||||
');
|
||||
$ret &= Db::getInstance()->execute('
|
||||
UPDATE `' ._DB_PREFIX_.'codwfeeplus_conditions`
|
||||
SET `codwfeeplus_categories` = \'\'
|
||||
');
|
||||
|
||||
return $ret;
|
||||
}
|
||||
50
modules/codwfeeplus/upgrade/install-1.0.4.php
Normal file
50
modules/codwfeeplus/upgrade/install-1.0.4.php
Normal file
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
/** Copyright 2018 Sakis Gkiokas
|
||||
* This file is part of codwfeeplus module for Prestashop.
|
||||
*
|
||||
* Codwfeeplus is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Codwfeeplus is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* For any recomendations and/or suggestions please contact me
|
||||
* at sakgiok@gmail.com
|
||||
*
|
||||
* @author Sakis Gkiokas <sakgiok@gmail.com>
|
||||
* @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;
|
||||
}
|
||||
32
modules/codwfeeplus/upgrade/install-1.0.5.php
Normal file
32
modules/codwfeeplus/upgrade/install-1.0.5.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
/** Copyright 2018 Sakis Gkiokas
|
||||
* This file is part of codwfeeplus module for Prestashop.
|
||||
*
|
||||
* Codwfeeplus is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Codwfeeplus is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* For any recommendations and/or suggestions please contact me
|
||||
* at sakgiok@gmail.com
|
||||
*
|
||||
* @author Sakis Gkiokas <sakgiok@gmail.com>
|
||||
* @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_5($object)
|
||||
{
|
||||
$ret = true;
|
||||
$ret &= $object->registerHook('header');
|
||||
|
||||
return $ret;
|
||||
}
|
||||
92
modules/codwfeeplus/upgrade/install-1.0.6.php
Normal file
92
modules/codwfeeplus/upgrade/install-1.0.6.php
Normal file
@@ -0,0 +1,92 @@
|
||||
<?php
|
||||
/** Copyright 2018 Sakis Gkiokas
|
||||
* This file is part of codwfeeplus module for Prestashop.
|
||||
*
|
||||
* Codwfeeplus is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Codwfeeplus is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* For any recommendations and/or suggestions please contact me
|
||||
* at sakgiok@gmail.com
|
||||
*
|
||||
* @author Sakis Gkiokas <sakgiok@gmail.com>
|
||||
* @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_6($object)
|
||||
{
|
||||
if (Shop::isFeatureActive()) {
|
||||
Shop::setContext(Shop::CONTEXT_ALL);
|
||||
}
|
||||
//old vars
|
||||
Configuration::deleteByName('PS_CODWFEEPLUS_BEHAVIOUR');
|
||||
Configuration::deleteByName('PS_CODWFEEPLUS_KEEPTRANSACTIONS');
|
||||
|
||||
$ret = true;
|
||||
$title = array();
|
||||
$id_tab = (int) Tab::getIdFromClassName('AdminCODwFeePlus');
|
||||
$tab = new Tab((int) $id_tab);
|
||||
foreach (Language::getLanguages(true) as $lang) {
|
||||
if ($lang['iso_code'] == 'el') {
|
||||
$title[$lang['id_lang']] = 'Χρέωση Αντικαταβολής';
|
||||
} else {
|
||||
$title[$lang['id_lang']] = 'Cash on Delivery Fee';
|
||||
}
|
||||
$tab->name[$lang['id_lang']] = $object->getTranslation('COD with Fee Plus', $lang['iso_code'], $object->name);
|
||||
}
|
||||
$ret &= $tab->save();
|
||||
unset($tab);
|
||||
$ret &= Configuration::updateValue('SG_CODWFEEPLUS_AUTO_UPDATE', 0);
|
||||
$ret &= Configuration::updateValue('SG_CODWFEEPLUS_INFO_LINK', 'https://sakgiok.gr');
|
||||
$ret &= Configuration::updateValue('SG_CODWFEEPLUS_PRODUCT_TITLE', $title);
|
||||
$ret &= Configuration::updateValue('SG_CODWFEEPLUS_PRODUCT_REFERENCE', 'COD');
|
||||
$ret &= Configuration::updateValue('SG_CODWFEEPLUS_PRODUCT_ID', 0);
|
||||
$ret &= Configuration::updateValue('SG_CODWFEEPLUS_MATCHALL_CATEGORIES', 0); //0 match any, 1 match all
|
||||
$ret &= Configuration::updateValue('SG_CODWFEEPLUS_MATCHALL_GROUPS', 0); //0 match any, 1 match all
|
||||
$ret &= Configuration::updateValue('SG_CODWFEEPLUS_INTEGRATION_WAY', 0); //0 by condition - 1 Add to carrier's fee - 2 Add new product
|
||||
$ret &= Db::getInstance()->execute('
|
||||
ALTER TABLE `' ._DB_PREFIX_.'codwfeeplus_conditions`
|
||||
ADD `codwfeeplus_groups` TEXT AFTER `codwfeeplus_categories`
|
||||
');
|
||||
$ret &= Db::getInstance()->execute('
|
||||
ALTER TABLE `' ._DB_PREFIX_.'codwfeeplus_conditions`
|
||||
ADD `codwfeeplus_integration` int(2) unsigned NOT NULL DEFAULT \'0\' AFTER `codwfeeplus_fee_type`
|
||||
');
|
||||
$ret &= Db::getInstance()->execute('
|
||||
ALTER TABLE `' ._DB_PREFIX_.'codwfeeplus_conditions`
|
||||
ADD `codwfeeplus_shops` TEXT AFTER `codwfeeplus_groups`
|
||||
');
|
||||
$ret &= Db::getInstance()->execute('
|
||||
UPDATE `' ._DB_PREFIX_.'codwfeeplus_conditions`
|
||||
SET `codwfeeplus_groups` = \'\'
|
||||
');
|
||||
$ret &= Db::getInstance()->execute('
|
||||
UPDATE `' ._DB_PREFIX_.'codwfeeplus_conditions`
|
||||
SET `codwfeeplus_integration` = 0
|
||||
');
|
||||
$ret &= Db::getInstance()->execute('
|
||||
UPDATE `' ._DB_PREFIX_.'codwfeeplus_conditions`
|
||||
SET `codwfeeplus_shops` = \'\'
|
||||
');
|
||||
$ret &= Db::getInstance()->execute('
|
||||
ALTER TABLE `' ._DB_PREFIX_.'codwfeeplus_conditions`
|
||||
ADD `codwfeeplus_taxrule_id` int(2) unsigned NOT NULL DEFAULT \'0\' AFTER `codwfeeplus_integration`
|
||||
');
|
||||
$ret &= Db::getInstance()->execute('
|
||||
UPDATE `' ._DB_PREFIX_.'codwfeeplus_conditions`
|
||||
SET `codwfeeplus_taxrule_id` = 0
|
||||
');
|
||||
$ret &= $object->installCODProduct();
|
||||
|
||||
return $ret;
|
||||
}
|
||||
36
modules/codwfeeplus/upgrade/install-1.1.0.php
Normal file
36
modules/codwfeeplus/upgrade/install-1.1.0.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
/** Copyright 2018 Sakis Gkiokas
|
||||
* This file is part of codwfeeplus module for Prestashop.
|
||||
*
|
||||
* Codwfeeplus is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Codwfeeplus is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* For any recommendations and/or suggestions please contact me
|
||||
* at sakgiok@gmail.com
|
||||
*
|
||||
* @author Sakis Gkiokas <sakgiok@gmail.com>
|
||||
* @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_1_0($object)
|
||||
{
|
||||
$ret = true;
|
||||
$ret &= Db::getInstance()->execute('
|
||||
ALTER TABLE `' . _DB_PREFIX_ . 'codwfeeplus_conditions`
|
||||
ADD `codwfeeplus_condtype` tinyint(1) unsigned NOT NULL DEFAULT \'0\' AFTER `codwfeeplus_active`
|
||||
');
|
||||
|
||||
return $ret;
|
||||
}
|
||||
37
modules/codwfeeplus/upgrade/install-1.1.2.php
Normal file
37
modules/codwfeeplus/upgrade/install-1.1.2.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
/** Copyright 2018 Sakis Gkiokas
|
||||
* This file is part of codwfeeplus module for Prestashop.
|
||||
*
|
||||
* Codwfeeplus is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Codwfeeplus is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* For any recommendations and/or suggestions please contact me
|
||||
* at sakgiok@gmail.com
|
||||
*
|
||||
* @author Sakis Gkiokas <sakgiok@gmail.com>
|
||||
* @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_1_2($object)
|
||||
{
|
||||
$ret = true;
|
||||
$ret &= Configuration::updateValue('SG_CODWFEEPLUS_ORDERSTATE', Configuration::get('PS_OS_PREPARATION'));
|
||||
$ret &= Db::getInstance()->execute('
|
||||
ALTER TABLE `' . _DB_PREFIX_ . 'codwfeeplus_conditions`
|
||||
ADD `codwfeeplus_orderstate_id` int(2) unsigned NOT NULL DEFAULT \'0\' AFTER `codwfeeplus_taxrule_id`
|
||||
');
|
||||
|
||||
return $ret;
|
||||
}
|
||||
39
modules/codwfeeplus/upgrade/install-1.1.7.php
Normal file
39
modules/codwfeeplus/upgrade/install-1.1.7.php
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
/** Copyright 2018 Sakis Gkiokas
|
||||
* This file is part of codwfeeplus module for Prestashop.
|
||||
*
|
||||
* Codwfeeplus is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Codwfeeplus is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* For any recommendations and/or suggestions please contact me
|
||||
* at sakgiok@gmail.com
|
||||
*
|
||||
* @author Sakis Gkiokas <sakgiok@gmail.com>
|
||||
* @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_1_7($object)
|
||||
{
|
||||
$ret = true;
|
||||
$ret &= Db::getInstance()->execute('
|
||||
ALTER TABLE `' . _DB_PREFIX_ . 'codwfeeplus_conditions`
|
||||
ADD `codwfeeplus_states` TEXT NULL AFTER `codwfeeplus_countries`
|
||||
');
|
||||
$ret &= Db::getInstance()->execute('
|
||||
UPDATE `' ._DB_PREFIX_.'codwfeeplus_conditions`
|
||||
SET `codwfeeplus_states` = \'\'
|
||||
');
|
||||
return $ret;
|
||||
}
|
||||
Reference in New Issue
Block a user