feat(main): Groups and blocks

This commit is contained in:
2026-08-10 16:13:15 +02:00
parent 6aff506cd6
commit 635c13a0ed
39 changed files with 1188 additions and 237 deletions
@@ -0,0 +1,36 @@
<?php
namespace Websmid\CustomHtml\Form\ChoiceProvider;
use PrestaShop\PrestaShop\Core\Form\ConfigurableFormChoiceProviderInterface;
use PrestaShop\PrestaShop\Core\Form\FormChoiceAttributeProviderInterface;
use PrestaShop\PrestaShop\Core\Form\FormChoiceProviderInterface;
use Db;
final class CustomHtmlGroupChoiceProvider implements
FormChoiceProviderInterface,
FormChoiceAttributeProviderInterface,
ConfigurableFormChoiceProviderInterface
{
public function getChoices(array $options = []): array
{
$groups = Db::getInstance()->executeS(
'SELECT `id_ws_customhtml_group`, `title`
FROM `' . _DB_PREFIX_ . 'ws_customhtml_group`
ORDER BY `title` ASC'
);
$choices = [];
foreach ($groups as $group) {
$choices[$group['title']] = (int) $group['id_ws_customhtml_group'];
}
return $choices;
}
public function getChoicesAttributes(): array
{
return [];
}
}