config();
$data = [];
$data['env'] = discountApp()->env();
$data['enable'] = $this->getCheckTemplate($config->get('enable'));
$data['update_element_index'] = $this->getCheckTemplate($config->get('update_element_index'));
$priceTypeIdList = $config->get('catalog_group_id_list', []);
$data['catalog_group_id_list'] = $priceTypeIdList->join(', ');
foreach ($priceTypeIdList as $priceTypeId){
$priceTypeEntity = app()->factory()->shop()->getPriceTypeFactory()->getEntityById($priceTypeId);
if($priceTypeEntity){
$linkTemplate = "getUrl()}\" target=\"_blank\">$priceTypeId";
$data["catalog_group_id_list_$priceTypeId"] = "[$linkTemplate] {$priceTypeEntity->getName()}";
}
}
$data['page_size'] = $config->get('page_size');
?>
$value) {
?>| = $key ?> | = $value ?> |
Инфоблоки
| Config Name |
Title |
isSectionProperty |
config('catalog_iblock_id', 0);
$catalogTitle = "".($catalogIBlockId?:'Undefined'). '';
$catalogEntity = app()->factory()->main()->getIBlockFactory()->getEntityById($catalogIBlockId);
if($catalogEntity){
$catalogTitle = "[{$catalogEntity->getId()}] {$catalogEntity->getName()}";
$catalogTitle = "[getAdminUrl()}\" target=\"_blank\">{$catalogEntity->getId()}] {$catalogEntity->getName()}";
}
?>
| ='catalog_iblock_id'?> | =$catalogTitle?> | =$catalogEntity->isSectionProperty()?'Да':'Нет'?> |
Mapping
factory()->iBlock()->getEntityById($catalogIBlockId);
$propertyFactory = $af->getPropertyFactory();
$map = $config->get('MAP', [])->toArray();
?>
| Type | Property | PropertyValue |
$typeMap){
foreach ($typeMap as $propertyCode => $propertyValue) {
\Bx\Discount\Tools::prepareMapPropertyCodeAndValue($propertyCode, $propertyValue);
$propertyEntity = $propertyFactory->getEntityByCode($propertyCode);
if($propertyEntity?->getBaseType() != 'L'){
continue;
}
/**
* @var \Wt\Core\Collection\IBlock\PropertyEnumCollection $valueCollection
*/
$valueCollection = $propertyEntity->getValueCollection();
$valueEntity = $valueCollection->getByXmlId($propertyValue);
?>
| = $type ?> |
getUrl();
$linkTemplate = "getUrl()}\" target=\"_blank\">{$propertyEntity->getId()}";
echo "[$linkTemplate] {$propertyEntity->getName()}";
?> |
getId()}] {$valueEntity->getName()}";
}
?> |