feat(main): Add slider block type

This commit is contained in:
2026-08-25 14:32:21 +02:00
parent 06e98a429b
commit be9a676d9d
28 changed files with 729 additions and 120 deletions
+48
View File
@@ -0,0 +1,48 @@
<?php
if (!defined('_PS_VERSION_')) {
exit;
}
function upgrade_module_1_16_0($module)
{
$columnsToAdd = [
'slides_per_view_mobile' => 'DECIMAL(4,2) NOT NULL DEFAULT 1',
'slides_per_view_tablet' => 'DECIMAL(4,2) NOT NULL DEFAULT 2',
'slides_per_view_desktop' => 'DECIMAL(4,2) NOT NULL DEFAULT 3',
'autoplay_delay' => 'INT(11) NOT NULL DEFAULT 0',
];
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 Db::getInstance()->execute(
'CREATE TABLE IF NOT EXISTS `' . _DB_PREFIX_ . 'ws_customhtml_slide` (
`id_ws_customhtml_slide` INT(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
`id_ws_customhtml` INT(11) NOT NULL,
`title` VARCHAR(256) NOT NULL DEFAULT \'\',
`description` TEXT,
`extra_description` TEXT,
`link` VARCHAR(512) NOT NULL DEFAULT \'\',
`link_text` VARCHAR(128) NOT NULL DEFAULT \'\',
`image` VARCHAR(255) NOT NULL DEFAULT \'\',
`ordering` INT(11) NOT NULL DEFAULT 0,
`date_add` DATETIME NOT NULL,
`date_upd` DATETIME NOT NULL,
KEY `id_ws_customhtml` (`id_ws_customhtml`)
)'
);
}