feat(main): Add banner option

This commit is contained in:
2026-08-13 13:59:08 +02:00
parent fb641fc236
commit ce480314f3
22 changed files with 316 additions and 39 deletions
+34
View File
@@ -0,0 +1,34 @@
<?php
if (!defined('_PS_VERSION_')) {
exit;
}
function upgrade_module_1_6_0($module)
{
$columnsToAdd = [
'description' => 'TEXT',
'extra_description' => 'TEXT',
'link' => 'VARCHAR(512) NOT NULL DEFAULT \'\'',
'template' => 'VARCHAR(32) NOT NULL DEFAULT \'image_left\'',
'image' => 'VARCHAR(255) NOT NULL DEFAULT \'\'',
];
foreach ($columnsToAdd as $column => $definition) {
$existing = Db::getInstance()->executeS(
'SHOW COLUMNS FROM `' . _DB_PREFIX_ . 'ws_customhtml` LIKE \'' . $column . '\''
);
if (!empty($existing)) {
continue;
}
if (!Db::getInstance()->execute(
'ALTER TABLE `' . _DB_PREFIX_ . 'ws_customhtml` ADD COLUMN `' . $column . '` ' . $definition
)) {
return false;
}
}
return true;
}