From 07224f9530ef85726e4a7b6a8cafc782399ab3b6 Mon Sep 17 00:00:00 2001 From: Daniel Seifert Date: Thu, 5 Dec 2024 12:15:33 +0100 Subject: [PATCH] parse manufacturer longdesc through Smarty --- .../Model/ManufacturerInfoList.php | 24 +++++++++++++------ 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/Modules/Application/Model/ManufacturerInfoList.php b/Modules/Application/Model/ManufacturerInfoList.php index 8de9883..74f54f7 100644 --- a/Modules/Application/Model/ManufacturerInfoList.php +++ b/Modules/Application/Model/ManufacturerInfoList.php @@ -33,13 +33,23 @@ class ManufacturerInfoList extends ManufacturerInfoList_parent { parent::addCategoryFields($oManufacturer); - if (Registry::getConfig()->d3GetBoolModuleSettingByName('_showManufacturertextOnManufacturerPage')) { - $oManufacturer->oxcategories__oxlongdesc = new Field( - html_entity_decode( - $oManufacturer->getFieldData(Constants::D3_OXMANUFACTURERS_LONGDESC_FIELDNAME) ?? '' - ), - Field::T_RAW - ); + if (Registry::getConfig()->getConfigParam('d3manufacturerinformation_showManufacturertextOnManufacturerPage')) { + /** @var \OxidEsales\Eshop\Core\UtilsView $oUtilsView */ + $oUtilsView = Registry::getUtilsView(); + + $longdesc = $oManufacturer->d3GetLongdesc()->getRawValue() ?? ''; + $deactivateSmarty = Registry::getConfig()->getConfigParam('deactivateSmartyForCmsContent'); + $processLongDescriptions = Registry::getConfig()->getConfigParam('bl_perfParseLongDescinSmarty'); + if (!$deactivateSmarty && $processLongDescriptions) { + $longdesc = $oUtilsView->parseThroughSmarty( + $longdesc, + $oManufacturer->getId() . $oManufacturer->getLanguage(), + null, + true + ) ?? ''; + } + + $oManufacturer->oxcategories__oxlongdesc = new Field(html_entity_decode($longdesc), Field::T_RAW); } } }