Upgrade-5.2.8.php ➔ upgrade_module_5_2_8()   C
last analyzed

Complexity

Conditions 8
Paths 33

Size

Total Lines 25
Code Lines 19

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 8
eloc 19
nc 33
nop 1
dl 0
loc 25
rs 5.3846
c 0
b 0
f 0
1
<?php
2
/**
3
* 2007-2017 PrestaShop
4
*
5
* NOTICE OF LICENSE
6
*
7
* This source file is subject to the Academic Free License (AFL 3.0)
8
* that is bundled with this package in the file LICENSE.txt.
9
* It is also available through the world-wide-web at this URL:
10
* http://opensource.org/licenses/afl-3.0.php
11
* If you did not receive a copy of the license and are unable to
12
* obtain it through the world-wide-web, please send an email
13
* to [email protected] so we can send you a copy immediately.
14
*
15
* DISCLAIMER
16
*
17
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
18
* versions in the future. If you wish to customize PrestaShop for your
19
* needs please refer to http://www.prestashop.com for more information.
20
*
21
*  @author    PrestaShop SA <[email protected]>
22
*  @copyright 2007-2017 PrestaShop SA
23
*  @license   http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
24
*  International Registered Trademark & Property of PrestaShop SA
25
*/
26
27
if (!defined('_PS_VERSION_')) {
28
    exit;
29
}
30
31
function upgrade_module_5_2_8($object)
32
{
33
    if (Configuration::get('PAYLATER_ANALYTICS')) {
34
        return Configuration::deleteByName('PAYLATER_ANALYTICS');
35
    }
36
    if ((bool)Configuration::get('PAYLATER_TYPE')) {
37
        Configuration::updateValue('PAYLATER_WIDGET', 'true');
38
    } else {
39
        Configuration::updateValue('PAYLATER_WIDGET', 'false');
40
    }
41
    if ((bool)Configuration::get('PAYLATER_CART_WIDGET')) {
42
        Configuration::updateValue('PAYLATER_CART_WIDGET', 'true');
43
    } else {
44
        Configuration::updateValue('PAYLATER_CART_WIDGET', 'false');
45
    }
46
    if ((bool)Configuration::get('PAYLATER_PRODUCT_WIDGET')) {
47
        Configuration::updateValue('PAYLATER_PRODUCT_WIDGET', '-1');
48
    } else {
49
        Configuration::updateValue('PAYLATER_PRODUCT_WIDGET', '-1');
50
    }
51
    return ($object->registerHook('displayProductButtons')
52
      && $object->registerHook('displayRightColumnProduct')
53
      && $object->registerHook('displayRightColumn')
54
      && $object->registerHook('displayShoppingCart'));
55
}
56