From 5a6f8a157713c8558937d7e0cdf20e30ccd4395a Mon Sep 17 00:00:00 2001 From: Daniel Seifert Date: Thu, 21 Nov 2024 17:01:14 +0100 Subject: [PATCH] make displaying manufacturer information on manufacturer list page configurable --- .../de/d3manufacturerinformation_lang.php | 1 + .../en/d3manufacturerinformation_lang.php | 3 ++- CHANGELOG.md | 13 ++----------- .../Application/Model/ManufacturerInfoList.php | 15 +++++++++------ metadata.php | 14 ++++++++++---- 5 files changed, 24 insertions(+), 22 deletions(-) diff --git a/Application/views/admin_smarty/de/d3manufacturerinformation_lang.php b/Application/views/admin_smarty/de/d3manufacturerinformation_lang.php index e4e5a6b..15ce7e0 100644 --- a/Application/views/admin_smarty/de/d3manufacturerinformation_lang.php +++ b/Application/views/admin_smarty/de/d3manufacturerinformation_lang.php @@ -23,4 +23,5 @@ $aLang = [ 'mxd3manufacturerinfolongdesc' => 'Langtext', 'SHOP_MODULE_GROUP_d3manufacturerinformation_main' => 'Einstellungen', 'SHOP_MODULE_d3manufacturerinformation_showManufacturertextOnDetailsPage' => 'vorhandene Herstellertexte auf Artikeldetails als Tab anzeigen', + 'SHOP_MODULE_d3manufacturerinformation_showManufacturertextOnManufacturerPage' => 'Herstellertexte auf Herstellerseite anzeigen', ]; diff --git a/Application/views/admin_smarty/en/d3manufacturerinformation_lang.php b/Application/views/admin_smarty/en/d3manufacturerinformation_lang.php index 834195b..f898b05 100644 --- a/Application/views/admin_smarty/en/d3manufacturerinformation_lang.php +++ b/Application/views/admin_smarty/en/d3manufacturerinformation_lang.php @@ -22,5 +22,6 @@ $aLang = [ 'mxd3manufacturerinfolongdesc' => 'Text', 'SHOP_MODULE_GROUP_d3manufacturerinformation_main' => 'Settings', - 'SHOP_MODULE_d3manufacturerinformation_showManufacturertextOnDetailsPage' => 'display existing manufacturer texts on item details as a tab', + 'SHOP_MODULE_d3manufacturerinformation_showManufacturertextOnDetailsPage' => 'show existing manufacturer texts on item details page as a tab', + 'SHOP_MODULE_d3manufacturerinformation_showManufacturertextOnManufacturerPage' => 'show manufacturer texts on manufacturer page', ]; diff --git a/CHANGELOG.md b/CHANGELOG.md index c1504da..18861ec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,19 +8,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [2.0.1.0](https://git.d3data.de/D3Private/manufacturer-information/compare/2.0.0.0...2.0.1.0) - 2024-11-20 ### Fixed -- show hidden save button -- installation instructions -- show manufacturer link on article details page, if manufacturer hasn't an icon -- prevent encoding HTML entities +- content encoding on manufacturers list page ### Added -- display manufacturer content as additional tab on article details page -- make displaying manufacturer tab on details page configurable -- hide empty HTML elements content - -## [2.0.0.0](https://git.d3data.de/D3Private/manufacturer-information/compare/1.1.2.1...2.0.0.0) - 2024-11-16 -### Added -- installability OXID 7.0 - 7.1 +- displaying content on manufacturers list page configurable ## [1.1.2.1](https://git.d3data.de/D3Private/manufacturer-information/compare/1.1.2.0...1.1.2.1) - 2024-11-21 ### Fixed diff --git a/Modules/Application/Model/ManufacturerInfoList.php b/Modules/Application/Model/ManufacturerInfoList.php index 9ac05bc..d65f255 100644 --- a/Modules/Application/Model/ManufacturerInfoList.php +++ b/Modules/Application/Model/ManufacturerInfoList.php @@ -21,6 +21,7 @@ use D3\ManufacturerInformation\Application\Model\Constants; use OxidEsales\Eshop\Application\Model\Manufacturer; use OxidEsales\Eshop\Application\Model\ManufacturerList; use OxidEsales\Eshop\Core\Field; +use OxidEsales\Eshop\Core\Registry; class ManufacturerInfoList extends ManufacturerInfoList_parent { @@ -32,11 +33,13 @@ class ManufacturerInfoList extends ManufacturerInfoList_parent { parent::addCategoryFields($oManufacturer); - $oManufacturer->oxcategories__oxlongdesc = new Field( - html_entity_decode( - $oManufacturer->getFieldData(Constants::D3_OXMANUFACTURERS_LONGDESC_FIELDNAME) ?? '' - ), - Field::T_RAW - ); + if (Registry::getConfig()->getConfigParam('d3manufacturerinformation_showManufacturertextOnManufacturerPage')) { + $oManufacturer->oxcategories__oxlongdesc = new Field( + html_entity_decode( + $oManufacturer->getFieldData( Constants::D3_OXMANUFACTURERS_LONGDESC_FIELDNAME ) ?? '' + ), + Field::T_RAW + ); + } } } diff --git a/metadata.php b/metadata.php index db8ca23..f10fa9d 100644 --- a/metadata.php +++ b/metadata.php @@ -38,8 +38,8 @@ $aModule = [ 'en' => 'adds manufacturer information to the article list', ], 'thumbnail' => 'image-file.png', - 'version' => '2.1.0.0', - 'author' => '(D3) Data Development (Inh.: Thomas Dartsch)', + 'version' => '1.1.2.0', + 'author' => $logo.' Data Development (Inh.: Thomas Dartsch)', 'email' => 'support@shopmodule.com', 'url' => 'https://www.oxidmodule.com/', 'controllers' => [ @@ -54,8 +54,14 @@ $aModule = [ ], 'settings' => [ [ - 'group' => Constants::OXID_MODULE_ID.'_main', - 'name' => Constants::OXID_MODULE_ID.'_showManufacturertextOnDetailsPage', + 'group' => $sModuleId.'_main', + 'name' => $sModuleId.'_showManufacturertextOnDetailsPage', + 'type' => 'bool', + 'value' => true, + ], + [ + 'group' => $sModuleId.'_main', + 'name' => $sModuleId.'_showManufacturertextOnManufacturerPage', 'type' => 'bool', 'value' => true, ],