update
This commit is contained in:
32
modules/empikmarketplace/upgrade/upgrade-1.1.0.php
Normal file
32
modules/empikmarketplace/upgrade/upgrade-1.1.0.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
use Empik\Marketplace\Cache\CacheClearer;
|
||||
use Empik\Marketplace\Utils\DbUtils;
|
||||
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param EmpikMarketplace $object
|
||||
* @return bool
|
||||
*/
|
||||
function upgrade_module_1_1_0($object)
|
||||
{
|
||||
(new CacheClearer($object))->clear();
|
||||
|
||||
$result = true;
|
||||
|
||||
$sql = [];
|
||||
|
||||
$sql[] = ['product', 'empik_offer_price', 'DECIMAL(20, 2) NOT NULL DEFAULT 0'];
|
||||
$sql[] = ['product', 'empik_offer_price_reduced', 'DECIMAL(20, 2) NOT NULL DEFAULT 0'];
|
||||
$sql[] = ['product_attribute', 'empik_offer_price', 'DECIMAL(20, 2) NOT NULL DEFAULT 0'];
|
||||
$sql[] = ['product_attribute', 'empik_offer_price_reduced', 'DECIMAL(20, 2) NOT NULL DEFAULT 0'];
|
||||
|
||||
foreach ($sql as $query) {
|
||||
$result &= DbUtils::safeAddColumn($query[0], $query[1], $query[2]);
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
18
modules/empikmarketplace/upgrade/upgrade-1.1.3.php
Normal file
18
modules/empikmarketplace/upgrade/upgrade-1.1.3.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
use Empik\Marketplace\Cache\CacheClearer;
|
||||
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param EmpikMarketplace $object
|
||||
* @return bool
|
||||
*/
|
||||
function upgrade_module_1_1_3($object)
|
||||
{
|
||||
(new CacheClearer($object))->clear();
|
||||
|
||||
return true;
|
||||
}
|
||||
25
modules/empikmarketplace/upgrade/upgrade-1.1.4.php
Normal file
25
modules/empikmarketplace/upgrade/upgrade-1.1.4.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
use Empik\Marketplace\Adapter\ConfigurationAdapter;
|
||||
use Empik\Marketplace\Cache\CacheClearer;
|
||||
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param EmpikMarketplace $object
|
||||
* @return bool
|
||||
*/
|
||||
function upgrade_module_1_1_4($object)
|
||||
{
|
||||
(new CacheClearer($object))->clear();
|
||||
|
||||
$result = true;
|
||||
|
||||
if (!Configuration::hasKey(ConfigurationAdapter::CONF_SKU_TYPE)) {
|
||||
$result &= Configuration::updateValue(ConfigurationAdapter::CONF_SKU_TYPE, 'REFERENCE');
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
20
modules/empikmarketplace/upgrade/upgrade-2.0.1.php
Normal file
20
modules/empikmarketplace/upgrade/upgrade-2.0.1.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
use Empik\Marketplace\Utils\DbUtils;
|
||||
|
||||
function upgrade_module_2_0_1($object)
|
||||
{
|
||||
$return = true;
|
||||
|
||||
$return &= DbUtils::safeAddColumn('empik_product', 'condition', 'INT(4) NOT NULL DEFAULT 11 AFTER logistic_class');
|
||||
$return &= DbUtils::safeAddColumn('empik_product', 'export_original_price', 'INT(1) NOT NULL DEFAULT 0 AFTER logistic_class');
|
||||
|
||||
$return &= DbUtils::safeDropColumn('product', 'empik_product_disabled');
|
||||
$return &= DbUtils::safeDropColumn('product', 'empik_offer_disabled');
|
||||
$return &= DbUtils::safeDropColumn('product', 'empik_offer_price');
|
||||
$return &= DbUtils::safeDropColumn('product', 'empik_offer_price_reduced');
|
||||
$return &= DbUtils::safeDropColumn('product_attribute', 'empik_offer_price');
|
||||
$return &= DbUtils::safeDropColumn('product_attribute', 'empik_offer_price_reduced');
|
||||
|
||||
return $return;
|
||||
}
|
||||
10
modules/empikmarketplace/upgrade/upgrade-2.0.3.php
Normal file
10
modules/empikmarketplace/upgrade/upgrade-2.0.3.php
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
use Empik\Marketplace\Utils\DbUtils;
|
||||
|
||||
function upgrade_module_2_0_3($object)
|
||||
{
|
||||
@unlink(__DIR__ . '/../views/PrestaShop/Admin/Product/CatalogPage/Lists/products_table.html.twig');
|
||||
|
||||
return true;
|
||||
}
|
||||
Reference in New Issue
Block a user