add empik module
This commit is contained in:
33
modules/empikmarketplace/upgrade/install-1.1.0.php
Normal file
33
modules/empikmarketplace/upgrade/install-1.1.0.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
use Empik\Marketplace\Cache\CacheClearer;
|
||||
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param EmpikMarketplace $object
|
||||
* @return bool
|
||||
*/
|
||||
function upgrade_module_1_1_0($object)
|
||||
{
|
||||
(new CacheClearer($object))->clear();
|
||||
|
||||
$result = true;
|
||||
|
||||
$installer = $object->getInstaller();
|
||||
|
||||
$result &= $installer->createTabs();
|
||||
|
||||
$sql[] = 'ALTER TABLE `' . _DB_PREFIX_ . 'product` ADD COLUMN `empik_offer_price` DECIMAL(20, 2) NOT NULL DEFAULT 0;';
|
||||
$sql[] = 'ALTER TABLE `' . _DB_PREFIX_ . 'product` ADD COLUMN `empik_offer_price_reduced` DECIMAL(20, 2) NOT NULL DEFAULT 0;';
|
||||
$sql[] = 'ALTER TABLE `' . _DB_PREFIX_ . 'product_attribute` ADD COLUMN `empik_offer_price` DECIMAL(20, 2) NOT NULL DEFAULT 0;';
|
||||
$sql[] = 'ALTER TABLE `' . _DB_PREFIX_ . 'product_attribute` ADD COLUMN `empik_offer_price_reduced` DECIMAL(20, 2) NOT NULL DEFAULT 0;';
|
||||
|
||||
foreach ($sql as $query) {
|
||||
$result &= Db::getInstance()->execute($query);
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
Reference in New Issue
Block a user