first commit

This commit is contained in:
2025-08-02 16:30:27 +02:00
commit 23646bfcee
14851 changed files with 1750626 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
<?php
/*
* Smarty plugin
* -------------------------------------------------------------
* Type: function
* Name: get_section
* Purpose: get a section of given id
* -------------------------------------------------------------
*/
use KupShop\CatalogBundle\Entity\Wrapper\CategoryWrapper;
use KupShop\KupShopBundle\Util\Compat\ServiceContainer;
function smarty_function_get_section($params, &$smarty)
{
if (!isset($params['id'])) {
return null;
}
$sectionTree = ServiceContainer::getService(\KupShop\CatalogBundle\Section\SectionTree::class);
$section = $sectionTree->getSectionById($params['id']);
if ($section) {
$section = ServiceContainer::getService(CategoryWrapper::class)->setObject($section);
} else {
$section = [];
}
if (!empty($params['assign'])) {
$smarty->assign($params['assign'], $section);
}
}