Compare commits
22 Commits
Author | SHA1 | Date | |
---|---|---|---|
9d43ddf078 | |||
4e19dea360 | |||
b93ea7a787 | |||
0a641b40c2 | |||
77bd789f14 | |||
c84a109281 | |||
00848cc007 | |||
6c0a476c80 | |||
b81c779b43 | |||
2af2e3bbcc | |||
ba123ad789 | |||
889f721279 | |||
0f6c3c41af | |||
a4bd6d5bfd | |||
2b0a3dc2a1 | |||
47a0759ced | |||
2838ab70be | |||
3a34f0e5f5 | |||
07224f9530 | |||
b278f8a185 | |||
bb6b465445 | |||
6f7acce537 |
@ -17,11 +17,12 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace D3\ManufacturerInformation\Application\Controller\Admin;
|
namespace D3\ManufacturerInformation\Application\Controller\Admin;
|
||||||
|
|
||||||
use D3\ManufacturerInformation\Application\Model\Constants;
|
|
||||||
use D3\ManufacturerInformation\Modules\Application\Model\D3ManufacturerLongDesc;
|
use D3\ManufacturerInformation\Modules\Application\Model\D3ManufacturerLongDesc;
|
||||||
|
use Exception;
|
||||||
use OxidEsales\Eshop\Application\Controller\Admin\AdminDetailsController;
|
use OxidEsales\Eshop\Application\Controller\Admin\AdminDetailsController;
|
||||||
use OxidEsales\Eshop\Application\Model\Manufacturer;
|
use OxidEsales\Eshop\Application\Model\Manufacturer;
|
||||||
use OxidEsales\Eshop\Core\Registry;
|
use OxidEsales\Eshop\Core\Registry;
|
||||||
|
use stdClass;
|
||||||
|
|
||||||
class ManufacturerInfoLongdesc extends AdminDetailsController
|
class ManufacturerInfoLongdesc extends AdminDetailsController
|
||||||
{
|
{
|
||||||
@ -33,12 +34,12 @@ class ManufacturerInfoLongdesc extends AdminDetailsController
|
|||||||
parent::render();
|
parent::render();
|
||||||
|
|
||||||
/** @var Manufacturer|D3ManufacturerLongDesc $oManufacturer */
|
/** @var Manufacturer|D3ManufacturerLongDesc $oManufacturer */
|
||||||
$this->_aViewData['edit'] = $oManufacturer = oxNew(\OxidEsales\Eshop\Application\Model\Manufacturer::class);
|
$this->_aViewData['edit'] = $oManufacturer = oxNew(Manufacturer::class);
|
||||||
|
|
||||||
$sOXID = $this->_aViewData["oxid"] = $this->getEditObjectId();
|
$sOXID = $this->_aViewData["oxid"] = $this->getEditObjectId();
|
||||||
if (isset($sOXID) && $sOXID != "-1") {
|
if (isset($sOXID) && $sOXID != "-1") {
|
||||||
// load object
|
// load object
|
||||||
$d3manufacturerlang = \OxidEsales\Eshop\Core\Registry::getRequest()->getRequestEscapedParameter("catlang");
|
$d3manufacturerlang = Registry::getRequest()->getRequestEscapedParameter("catlang");
|
||||||
|
|
||||||
if (!isset($d3manufacturerlang)) {
|
if (!isset($d3manufacturerlang)) {
|
||||||
$d3manufacturerlang = $this->_iEditLang;
|
$d3manufacturerlang = $this->_iEditLang;
|
||||||
@ -53,8 +54,8 @@ class ManufacturerInfoLongdesc extends AdminDetailsController
|
|||||||
$this->_aViewData['readonly'] = true;
|
$this->_aViewData['readonly'] = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (\OxidEsales\Eshop\Core\Registry::getLang()->getLanguageNames() as $id => $language) {
|
foreach (Registry::getLang()->getLanguageNames() as $id => $language) {
|
||||||
$oLang = new \stdClass();
|
$oLang = new stdClass();
|
||||||
$oLang->sLangDesc = $language;
|
$oLang->sLangDesc = $language;
|
||||||
$oLang->selected = ($id == $this->_iEditLang);
|
$oLang->selected = ($id == $this->_iEditLang);
|
||||||
$this->_aViewData["otherlang"][$id] = clone $oLang;
|
$this->_aViewData["otherlang"][$id] = clone $oLang;
|
||||||
@ -68,13 +69,13 @@ class ManufacturerInfoLongdesc extends AdminDetailsController
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @return void
|
* @return void
|
||||||
* @throws \Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public function save()
|
public function save(): void
|
||||||
{
|
{
|
||||||
parent::save();
|
parent::save();
|
||||||
|
|
||||||
$iManufacturerLang = intval(\OxidEsales\Eshop\Core\Registry::getRequest()->getRequestEscapedParameter("catlang"));
|
$iManufacturerLang = intval(Registry::getRequest()->getRequestEscapedParameter("catlang"));
|
||||||
$sOXID = $this->getEditObjectId();
|
$sOXID = $this->getEditObjectId();
|
||||||
$this->setEditObjectId($sOXID);
|
$this->setEditObjectId($sOXID);
|
||||||
|
|
||||||
@ -93,8 +94,8 @@ class ManufacturerInfoLongdesc extends AdminDetailsController
|
|||||||
$aParams = Registry::getRequest()->getRequestEscapedParameter("editval");
|
$aParams = Registry::getRequest()->getRequestEscapedParameter("editval");
|
||||||
$oManufacturer->assign($aParams);
|
$oManufacturer->assign($aParams);
|
||||||
|
|
||||||
if (false === is_null($this->d3GetLongdescParamValue($oManufacturer))) {
|
if (false === is_null($this->d3GetLongdescParamValue())) {
|
||||||
$oManufacturer->d3SetLongdesc($this->d3GetLongdescParamValue($oManufacturer));
|
$oManufacturer->d3SetLongdesc($this->d3GetLongdescParamValue());
|
||||||
$oManufacturer->save();
|
$oManufacturer->save();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -102,9 +103,9 @@ class ManufacturerInfoLongdesc extends AdminDetailsController
|
|||||||
/**
|
/**
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function d3GetLongdescParamValue(Manufacturer $oManufacturer): string
|
public function d3GetLongdescParamValue(): string
|
||||||
{
|
{
|
||||||
return (string) $aParams = Registry::getRequest()->getRequestEscapedParameter("editval")[$oManufacturer->getD3LongDescTableColumnName()];
|
return (string) Registry::getRequest()->getRequestEscapedParameter("editval")['oxmanufacturers__d3description'];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -113,13 +114,13 @@ class ManufacturerInfoLongdesc extends AdminDetailsController
|
|||||||
*
|
*
|
||||||
* @param $sValue
|
* @param $sValue
|
||||||
*
|
*
|
||||||
* @return mixed
|
* @return string
|
||||||
*/
|
*/
|
||||||
protected function processLongDesc($sValue)
|
protected function processLongDesc($sValue): string
|
||||||
{
|
{
|
||||||
$aSearch = ['&nbsp;', '&', '"', '&lang=', '<p> </p>', '<p> </p>'];
|
$aSearch = ['&nbsp;', '&', '"', '&lang=', '<p> </p>', '<p> </p>'];
|
||||||
$aReplace = [' ', '&', '"', '&lang=', '', ''];
|
$aReplace = [' ', '&', '"', '&lang=', '', ''];
|
||||||
|
|
||||||
return str_replace($aSearch, $aReplace, $sValue);
|
return (string) str_replace($aSearch, $aReplace, $sValue);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -18,10 +18,10 @@ $sLangName = "Deutsch";
|
|||||||
// RESOURCE IDENTITFIER = STRING
|
// RESOURCE IDENTITFIER = STRING
|
||||||
// -------------------------------
|
// -------------------------------
|
||||||
$aLang = [
|
$aLang = [
|
||||||
'charset' => 'UTF-8',
|
'charset' => 'UTF-8',
|
||||||
|
|
||||||
'mxd3manufacturerinfolongdesc' => 'Langtext',
|
'mxd3manufacturerinfolongdesc' => 'Langtext',
|
||||||
'SHOP_MODULE_GROUP_d3manufacturerinformation_main' => 'Einstellungen',
|
'SHOP_MODULE_GROUP_d3manufacturerinformation_main' => 'Einstellungen',
|
||||||
'SHOP_MODULE_d3manufacturerinformation_showManufacturertextOnDetailsPage' => 'vorhandene Herstellertexte auf Artikeldetails als Tab anzeigen',
|
'SHOP_MODULE_d3manufacturerinformation_showManufacturertextOnDetailsPage' => 'vorhandene Herstellertexte auf Artikeldetails als Tab anzeigen',
|
||||||
'SHOP_MODULE_d3manufacturerinformation_showManufacturertextOnManufacturerPage' => 'Herstellertexte auf Herstellerseite anzeigen',
|
'SHOP_MODULE_d3manufacturerinformation_showManufacturertextOnManufacturerPage' => 'Herstellertexte auf Herstellerseite anzeigen',
|
||||||
];
|
];
|
||||||
|
@ -18,10 +18,10 @@ $sLangName = "Deutsch";
|
|||||||
// RESOURCE IDENTITFIER = STRING
|
// RESOURCE IDENTITFIER = STRING
|
||||||
// -------------------------------
|
// -------------------------------
|
||||||
$aLang = [
|
$aLang = [
|
||||||
'charset' => 'UTF-8',
|
'charset' => 'UTF-8',
|
||||||
|
|
||||||
'mxd3manufacturerinfolongdesc' => 'Text',
|
'mxd3manufacturerinfolongdesc' => 'Text',
|
||||||
'SHOP_MODULE_GROUP_d3manufacturerinformation_main' => 'Settings',
|
'SHOP_MODULE_GROUP_d3manufacturerinformation_main' => 'Settings',
|
||||||
'SHOP_MODULE_d3manufacturerinformation_showManufacturertextOnDetailsPage' => 'show existing manufacturer texts on item details page 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',
|
'SHOP_MODULE_d3manufacturerinformation_showManufacturertextOnManufacturerPage' => 'show manufacturer texts on manufacturer page',
|
||||||
];
|
];
|
||||||
|
@ -18,10 +18,10 @@ $sLangName = "Deutsch";
|
|||||||
// RESOURCE IDENTITFIER = STRING
|
// RESOURCE IDENTITFIER = STRING
|
||||||
// -------------------------------
|
// -------------------------------
|
||||||
$aLang = [
|
$aLang = [
|
||||||
'charset' => 'UTF-8',
|
'charset' => 'UTF-8',
|
||||||
|
|
||||||
'mxd3manufacturerinfolongdesc' => 'Langtext',
|
'mxd3manufacturerinfolongdesc' => 'Langtext',
|
||||||
'SHOP_MODULE_GROUP_d3manufacturerinformation_main' => 'Einstellungen',
|
'SHOP_MODULE_GROUP_d3manufacturerinformation_main' => 'Einstellungen',
|
||||||
'SHOP_MODULE_d3manufacturerinformation_showManufacturertextOnDetailsPage' => 'vorhandene Herstellertexte auf Artikeldetails als Tab anzeigen',
|
'SHOP_MODULE_d3manufacturerinformation_showManufacturertextOnDetailsPage' => 'vorhandene Herstellertexte auf Artikeldetails als Tab anzeigen',
|
||||||
'SHOP_MODULE_d3manufacturerinformation_showManufacturertextOnManufacturerPage' => 'Herstellertexte auf Herstellerseite anzeigen',
|
'SHOP_MODULE_d3manufacturerinformation_showManufacturertextOnManufacturerPage' => 'Herstellertexte auf Herstellerseite anzeigen',
|
||||||
];
|
];
|
||||||
|
@ -18,10 +18,10 @@ $sLangName = "Deutsch";
|
|||||||
// RESOURCE IDENTITFIER = STRING
|
// RESOURCE IDENTITFIER = STRING
|
||||||
// -------------------------------
|
// -------------------------------
|
||||||
$aLang = [
|
$aLang = [
|
||||||
'charset' => 'UTF-8',
|
'charset' => 'UTF-8',
|
||||||
|
|
||||||
'mxd3manufacturerinfolongdesc' => 'Text',
|
'mxd3manufacturerinfolongdesc' => 'Text',
|
||||||
'SHOP_MODULE_GROUP_d3manufacturerinformation_main' => 'Settings',
|
'SHOP_MODULE_GROUP_d3manufacturerinformation_main' => 'Settings',
|
||||||
'SHOP_MODULE_d3manufacturerinformation_showManufacturertextOnDetailsPage' => 'display existing manufacturer texts on item details as a tab',
|
'SHOP_MODULE_d3manufacturerinformation_showManufacturertextOnDetailsPage' => 'display existing manufacturer texts on item details as a tab',
|
||||||
'SHOP_MODULE_d3manufacturerinformation_showManufacturertextOnManufacturerPage' => 'show manufacturer texts on manufacturer page',
|
'SHOP_MODULE_d3manufacturerinformation_showManufacturertextOnManufacturerPage' => 'show manufacturer texts on manufacturer page',
|
||||||
];
|
];
|
||||||
|
15
CHANGELOG.md
15
CHANGELOG.md
@ -4,7 +4,20 @@ All notable changes to this project will be documented in this file.
|
|||||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
## [unreleased](https://git.d3data.de/D3Private/manufacturer-information/compare/2.0.1.0...rel_2.x)
|
## [unreleased](https://git.d3data.de/D3Private/manufacturer-information/compare/2.0.3.1...rel_2.x)
|
||||||
|
|
||||||
|
## [2.0.3.1](https://git.d3data.de/D3Private/manufacturer-information/compare/2.0.3.0...2.0.3.1) - 2025-01-03
|
||||||
|
### Fixed
|
||||||
|
- installation instructions
|
||||||
|
- parsing Smarty based longdescription
|
||||||
|
- replace OXID >= 7.1 code by compatible one
|
||||||
|
- prevent unset object error in template
|
||||||
|
- align admin menu section
|
||||||
|
|
||||||
|
## [2.0.3.0](https://git.d3data.de/D3Private/manufacturer-information/compare/2.0.2.0...2.0.3.0) - 2024-12-19
|
||||||
|
### Added
|
||||||
|
- Dynamic Template Renderer Support
|
||||||
|
- Support for OXID 7.2
|
||||||
|
|
||||||
## [2.0.2.0](https://git.d3data.de/D3Private/manufacturer-information/compare/2.0.1.0...2.0.2.0) - 2024-11-22
|
## [2.0.2.0](https://git.d3data.de/D3Private/manufacturer-information/compare/2.0.1.0...2.0.2.0) - 2024-11-22
|
||||||
### Fixed
|
### Fixed
|
||||||
|
@ -18,7 +18,8 @@ declare(strict_types=1);
|
|||||||
namespace D3\ManufacturerInformation\Modules\Application\Model;
|
namespace D3\ManufacturerInformation\Modules\Application\Model;
|
||||||
|
|
||||||
use D3\ManufacturerInformation\Application\Model\Constants;
|
use D3\ManufacturerInformation\Application\Model\Constants;
|
||||||
use OxidEsales\Eshop\Application\Model\Manufacturer;
|
use Exception;
|
||||||
|
use OxidEsales\Eshop\Core\Field;
|
||||||
use OxidEsales\Eshop\Core\Registry;
|
use OxidEsales\Eshop\Core\Registry;
|
||||||
|
|
||||||
class D3ManufacturerLongDesc extends D3ManufacturerLongDesc_parent
|
class D3ManufacturerLongDesc extends D3ManufacturerLongDesc_parent
|
||||||
@ -33,7 +34,7 @@ class D3ManufacturerLongDesc extends D3ManufacturerLongDesc_parent
|
|||||||
try {
|
try {
|
||||||
$this->assign([Constants::D3_OXMANUFACTURERS_LONGDESC_FIELDNAME => $sValue]);
|
$this->assign([Constants::D3_OXMANUFACTURERS_LONGDESC_FIELDNAME => $sValue]);
|
||||||
$this->save();
|
$this->save();
|
||||||
} catch (\Exception $exception) {
|
} catch ( Exception $exception) {
|
||||||
Registry::getLogger()->error($exception->getMessage());
|
Registry::getLogger()->error($exception->getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -42,11 +43,12 @@ class D3ManufacturerLongDesc extends D3ManufacturerLongDesc_parent
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return string
|
* @return Field
|
||||||
*/
|
*/
|
||||||
public function d3GetLongdesc(): string
|
public function d3GetLongdesc(): Field
|
||||||
{
|
{
|
||||||
return $this->getFieldData(Constants::D3_OXMANUFACTURERS_LONGDESC_FIELDNAME);
|
$longName = $this->getFieldLongName(Constants::D3_OXMANUFACTURERS_LONGDESC_FIELDNAME);
|
||||||
|
return $this->$longName ?: oxNew(Field::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -56,4 +58,5 @@ class D3ManufacturerLongDesc extends D3ManufacturerLongDesc_parent
|
|||||||
{
|
{
|
||||||
return $this->getViewName(true).'__'.Constants::D3_OXMANUFACTURERS_LONGDESC_FIELDNAME;
|
return $this->getViewName(true).'__'.Constants::D3_OXMANUFACTURERS_LONGDESC_FIELDNAME;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -17,29 +17,64 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace D3\ManufacturerInformation\Modules\Application\Model;
|
namespace D3\ManufacturerInformation\Modules\Application\Model;
|
||||||
|
|
||||||
use D3\ManufacturerInformation\Application\Model\Constants;
|
|
||||||
use OxidEsales\Eshop\Application\Model\Manufacturer;
|
use OxidEsales\Eshop\Application\Model\Manufacturer;
|
||||||
use OxidEsales\Eshop\Application\Model\ManufacturerList;
|
|
||||||
use OxidEsales\Eshop\Core\Field;
|
use OxidEsales\Eshop\Core\Field;
|
||||||
use OxidEsales\Eshop\Core\Registry;
|
use OxidEsales\Eshop\Core\Registry;
|
||||||
|
use OxidEsales\EshopCommunity\Internal\Container\ContainerFactory;
|
||||||
|
use OxidEsales\EshopCommunity\Internal\Framework\Module\Facade\ModuleSettingService;
|
||||||
|
use OxidEsales\EshopCommunity\Internal\Framework\Module\Facade\ModuleSettingServiceInterface;
|
||||||
|
use OxidEsales\EshopCommunity\Internal\Framework\Templating\TemplateRendererBridgeInterface;
|
||||||
|
use OxidEsales\EshopCommunity\Internal\Framework\Templating\TemplateRendererInterface;
|
||||||
|
use Psr\Container\ContainerExceptionInterface;
|
||||||
|
use Psr\Container\NotFoundExceptionInterface;
|
||||||
|
|
||||||
class ManufacturerInfoList extends ManufacturerInfoList_parent
|
class ManufacturerInfoList extends ManufacturerInfoList_parent
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @param Manufacturer|D3ManufacturerLongDesc $oManufacturer
|
* @param Manufacturer|D3ManufacturerLongDesc $oManufacturer
|
||||||
|
*
|
||||||
* @return void
|
* @return void
|
||||||
|
* @throws ContainerExceptionInterface
|
||||||
|
* @throws NotFoundExceptionInterface
|
||||||
*/
|
*/
|
||||||
protected function addCategoryFields($oManufacturer)
|
protected function addCategoryFields($oManufacturer): void
|
||||||
{
|
{
|
||||||
parent::addCategoryFields($oManufacturer);
|
parent::addCategoryFields($oManufacturer);
|
||||||
|
|
||||||
if (Registry::getConfig()->d3GetBoolModuleSettingByName('_showManufacturertextOnManufacturerPage')) {
|
/** @var ModuleSettingService $setting */
|
||||||
$oManufacturer->oxcategories__oxlongdesc = new Field(
|
$setting = ContainerFactory::getInstance()->getContainer()->get(ModuleSettingServiceInterface::class);
|
||||||
html_entity_decode(
|
|
||||||
$oManufacturer->getFieldData(Constants::D3_OXMANUFACTURERS_LONGDESC_FIELDNAME) ?? ''
|
if ($setting->getBoolean('d3manufacturerinformation_showManufacturertextOnManufacturerPage', 'd3manufacturerinformation')) {
|
||||||
),
|
$longdesc = $oManufacturer->d3GetLongdesc( )->getRawValue() ?? '';
|
||||||
Field::T_RAW
|
$deactivateSmarty = Registry::getConfig()->getConfigParam('deactivateSmartyForCmsContent');
|
||||||
);
|
$processLongDescriptions = Registry::getConfig()->getConfigParam('bl_perfParseLongDescinSmarty');
|
||||||
|
if (!$deactivateSmarty && $processLongDescriptions) {
|
||||||
|
$viewData = array_merge(
|
||||||
|
Registry::getConfig()->getActiveView()->getViewData(),
|
||||||
|
[
|
||||||
|
'oShop' => Registry::getConfig()->getActiveShop(),
|
||||||
|
'oViewConf' => Registry::getConfig()->getActiveView()->getViewConfig()
|
||||||
|
]
|
||||||
|
);
|
||||||
|
|
||||||
|
$longdesc = $this->getRenderer()->renderFragment(
|
||||||
|
$longdesc,
|
||||||
|
sprintf('ox:%s%s', $oManufacturer->getId(), $oManufacturer->getLanguage()),
|
||||||
|
$viewData
|
||||||
|
) ?? '';
|
||||||
|
}
|
||||||
|
|
||||||
|
$oManufacturer->oxcategories__oxlongdesc = new Field(html_entity_decode($longdesc), Field::T_RAW);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return TemplateRendererInterface
|
||||||
|
* @throws ContainerExceptionInterface
|
||||||
|
* @throws NotFoundExceptionInterface
|
||||||
|
*/
|
||||||
|
private function getRenderer(): TemplateRendererInterface
|
||||||
|
{
|
||||||
|
return ContainerFactory::getInstance()->getContainer()->get(TemplateRendererBridgeInterface::class)->getTemplateRenderer();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -18,18 +18,23 @@ declare(strict_types=1);
|
|||||||
namespace D3\ManufacturerInformation\Modules\Core;
|
namespace D3\ManufacturerInformation\Modules\Core;
|
||||||
|
|
||||||
use D3\ManufacturerInformation\Application\Model\Constants;
|
use D3\ManufacturerInformation\Application\Model\Constants;
|
||||||
use OxidEsales\EshopCommunity\Core\Di\ContainerFacade;
|
use OxidEsales\EshopCommunity\Internal\Container\ContainerFactory;
|
||||||
use OxidEsales\EshopCommunity\Internal\Framework\Module\Facade\ModuleSettingServiceInterface;
|
use OxidEsales\EshopCommunity\Internal\Framework\Module\Facade\ModuleSettingServiceInterface;
|
||||||
|
use Psr\Container\ContainerExceptionInterface;
|
||||||
|
use Psr\Container\NotFoundExceptionInterface;
|
||||||
|
|
||||||
class ManufacturerConfig extends ManufacturerConfig_parent
|
class ManufacturerConfig extends ManufacturerConfig_parent
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @param string $sName
|
* @param string $sName
|
||||||
|
*
|
||||||
* @return bool
|
* @return bool
|
||||||
|
* @throws ContainerExceptionInterface
|
||||||
|
* @throws NotFoundExceptionInterface
|
||||||
*/
|
*/
|
||||||
public function d3GetBoolModuleSettingByName(string $sName): bool
|
public function d3GetBoolModuleSettingByName(string $sName): bool
|
||||||
{
|
{
|
||||||
$moduleSettingService = ContainerFacade::get(ModuleSettingServiceInterface::class);
|
$moduleSettingService = ContainerFactory::getInstance()->getContainer()->get(ModuleSettingServiceInterface::class);
|
||||||
|
|
||||||
return $moduleSettingService->getBoolean(Constants::OXID_MODULE_ID.$sName, Constants::OXID_MODULE_ID);
|
return $moduleSettingService->getBoolean(Constants::OXID_MODULE_ID.$sName, Constants::OXID_MODULE_ID);
|
||||||
}
|
}
|
||||||
|
@ -17,6 +17,7 @@ Dieses Paket erfordert einen mit Composer installierten OXID eShop in einer in d
|
|||||||
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
composer config repositories.d3manufacturerinformation vcs https://git.d3data.de/D3Public/manufacturer-information.git
|
||||||
composer require d3/manufacturerinformation:"~2.0.0"
|
composer require d3/manufacturerinformation:"~2.0.0"
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -25,9 +26,9 @@ Sofern nötig, bestätigen Sie bitte, dass Sie `package-name` erlauben, Code aus
|
|||||||
```bash
|
```bash
|
||||||
./vendor/bin/oe-eshop-db_migrate migrations:migrate d3manufacturerinformation
|
./vendor/bin/oe-eshop-db_migrate migrations:migrate d3manufacturerinformation
|
||||||
|
|
||||||
./vendor/bin/oe-console o:m:i source/modules/d3/manufacturerinformation
|
./vendor/bin/oe-console oe:module:install vendor/d3/manufacturerinformation
|
||||||
./vendor/bin/oe-console o:m:deact d3manufacturerinformation
|
./vendor/bin/oe-console oe:module:deactivate d3manufacturerinformation
|
||||||
./vendor/bin/oe-console o:m:act d3manufacturerinformation
|
./vendor/bin/oe-console oe:module:activate d3manufacturerinformation
|
||||||
|
|
||||||
./vendor/bin/oe-eshop-db_views_generate
|
./vendor/bin/oe-eshop-db_views_generate
|
||||||
```
|
```
|
||||||
@ -36,7 +37,7 @@ Leeren Sie anschlieĂźend den Temp Ordner des Shops.
|
|||||||
|
|
||||||
|
|
||||||
## Lizenz
|
## Lizenz
|
||||||
(Stand: 16.11.2024)
|
(Stand: 19.12.2024)
|
||||||
|
|
||||||
```
|
```
|
||||||
Copyright (c) D3 Data Development (Inh. Thomas Dartsch)
|
Copyright (c) D3 Data Development (Inh. Thomas Dartsch)
|
||||||
|
@ -27,10 +27,9 @@
|
|||||||
],
|
],
|
||||||
"require": {
|
"require": {
|
||||||
"php": "^8.0",
|
"php": "^8.0",
|
||||||
"oxid-esales/oxideshop-ce": "7.0 - 7.1"
|
"oxid-esales/oxideshop-ce": "7.0 - 7.2"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"oxid-esales/oxideshop-ce": "~6.14.0",
|
|
||||||
"friendsofphp/php-cs-fixer": "^3.9"
|
"friendsofphp/php-cs-fixer": "^3.9"
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
|
2
menu.xml
2
menu.xml
@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="ISO-8859-15"?>
|
<?xml version="1.0" encoding="ISO-8859-15"?>
|
||||||
<OX>
|
<OX>
|
||||||
<OXMENU id="NAVIGATION_ESHOPADMIN">
|
<OXMENU id="NAVIGATION_ESHOPADMIN">
|
||||||
<MAINMENU id="mxuadmin">
|
<MAINMENU id="mxmainmenu">
|
||||||
<SUBMENU id="mxmanufacturer" cl="manufacturer" list="manufacturer_list">
|
<SUBMENU id="mxmanufacturer" cl="manufacturer" list="manufacturer_list">
|
||||||
<TAB id="mxd3manufacturerinfolongdesc" cl="d3manufacturerinfolongdesc" />
|
<TAB id="mxd3manufacturerinfolongdesc" cl="d3manufacturerinfolongdesc" />
|
||||||
</SUBMENU>
|
</SUBMENU>
|
||||||
|
34
metadata.php
34
metadata.php
@ -30,32 +30,32 @@ $sModuleId = Constants::OXID_MODULE_ID;
|
|||||||
* Module information
|
* Module information
|
||||||
*/
|
*/
|
||||||
$aModule = [
|
$aModule = [
|
||||||
'id' => $sModuleId,
|
'id' => $sModuleId,
|
||||||
'title' => [
|
'title' => [
|
||||||
'de' => '(D3) Herstellerinformationen',
|
'de' => '(D3) Herstellerinformationen',
|
||||||
'en' => '(D3) Manufacturer information',
|
'en' => '(D3) Manufacturer information',
|
||||||
],
|
],
|
||||||
'description' => [
|
'description' => [
|
||||||
'de' => 'fĂĽgt Informationen der Hersteller zur Artikelliste hinzu',
|
'de' => 'fĂĽgt Informationen der Hersteller zur Artikelliste hinzu',
|
||||||
'en' => 'adds manufacturer information to the article list',
|
'en' => 'adds manufacturer information to the article list',
|
||||||
],
|
],
|
||||||
'thumbnail' => 'picture.svg',
|
'thumbnail' => 'picture.svg',
|
||||||
'version' => '2.0.2.0',
|
'version' => '2.0.3.1',
|
||||||
'author' => $logo.' Data Development (Inh.: Thomas Dartsch)',
|
'author' => '(D3) Data Development (Inh.: Thomas Dartsch)',
|
||||||
'email' => 'support@shopmodule.com',
|
'email' => 'support@shopmodule.com',
|
||||||
'url' => 'https://www.oxidmodule.com/',
|
'url' => 'https://www.oxidmodule.com/',
|
||||||
'controllers' => [
|
'controllers' => [
|
||||||
"d3manufacturerinfolongdesc" => ManufacturerInfoLongdesc::class,
|
"d3manufacturerinfolongdesc" => ManufacturerInfoLongdesc::class,
|
||||||
],
|
],
|
||||||
'extend' => [
|
'extend' => [
|
||||||
OEManufacturer::class => D3ManufacturerLongDesc::class,
|
OEManufacturer::class => D3ManufacturerLongDesc::class,
|
||||||
OEManufacturerList::class => ManufacturerInfoList::class,
|
OEManufacturerList::class => ManufacturerInfoList::class,
|
||||||
OEConfig::class => ManufacturerConfig::class,
|
OEConfig::class => ManufacturerConfig::class,
|
||||||
],
|
],
|
||||||
'templates' => [
|
'templates' => [
|
||||||
'@' . Constants::OXID_MODULE_ID . '/admin/d3manufacturerlongdesc.tpl' => 'views/smarty/admin/d3manufacturerlongdesc.tpl',
|
'@' . Constants::OXID_MODULE_ID . '/admin/d3manufacturerlongdesc.tpl' => 'views/smarty/admin/d3manufacturerlongdesc.tpl',
|
||||||
],
|
],
|
||||||
'settings' => [
|
'settings' => [
|
||||||
[
|
[
|
||||||
'group' => $sModuleId.'_main',
|
'group' => $sModuleId.'_main',
|
||||||
'name' => $sModuleId.'_showManufacturertextOnDetailsPage',
|
'name' => $sModuleId.'_showManufacturertextOnDetailsPage',
|
||||||
@ -69,7 +69,7 @@ $aModule = [
|
|||||||
'value' => true,
|
'value' => true,
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
'blocks' => [
|
'blocks' => [
|
||||||
[
|
[
|
||||||
'template' => 'page/details/inc/productmain.tpl',
|
'template' => 'page/details/inc/productmain.tpl',
|
||||||
'block' => 'details_productmain_manufacturersicon',
|
'block' => 'details_productmain_manufacturersicon',
|
||||||
|
@ -18,6 +18,7 @@ declare(strict_types=1);
|
|||||||
namespace D3\ManufacturerInformation\Migrations;
|
namespace D3\ManufacturerInformation\Migrations;
|
||||||
|
|
||||||
use Doctrine\DBAL\Schema\Schema;
|
use Doctrine\DBAL\Schema\Schema;
|
||||||
|
use Doctrine\DBAL\Schema\SchemaException;
|
||||||
use Doctrine\DBAL\Types\TextType;
|
use Doctrine\DBAL\Types\TextType;
|
||||||
use Doctrine\Migrations\AbstractMigration;
|
use Doctrine\Migrations\AbstractMigration;
|
||||||
|
|
||||||
@ -45,7 +46,7 @@ final class Version20241023154223 extends AbstractMigration
|
|||||||
/**
|
/**
|
||||||
* @param Schema $schema
|
* @param Schema $schema
|
||||||
* @return void
|
* @return void
|
||||||
* @throws \Doctrine\DBAL\Schema\SchemaException
|
* @throws SchemaException
|
||||||
*/
|
*/
|
||||||
public function d3AddLongdescColumnToOxmanufacturers(Schema $schema)
|
public function d3AddLongdescColumnToOxmanufacturers(Schema $schema)
|
||||||
{
|
{
|
||||||
|
@ -17,7 +17,9 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace D3\ManufacturerInformation\Migrations;
|
namespace D3\ManufacturerInformation\Migrations;
|
||||||
|
|
||||||
|
use Doctrine\DBAL\Exception;
|
||||||
use Doctrine\DBAL\Schema\Schema;
|
use Doctrine\DBAL\Schema\Schema;
|
||||||
|
use Doctrine\DBAL\Schema\SchemaException;
|
||||||
use Doctrine\DBAL\Types\TextType;
|
use Doctrine\DBAL\Types\TextType;
|
||||||
use Doctrine\Migrations\AbstractMigration;
|
use Doctrine\Migrations\AbstractMigration;
|
||||||
|
|
||||||
@ -44,8 +46,10 @@ final class Version20241028172608 extends AbstractMigration
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param Schema $schema
|
* @param Schema $schema
|
||||||
|
*
|
||||||
* @return void
|
* @return void
|
||||||
* @throws \Doctrine\DBAL\Schema\SchemaException
|
* @throws Exception
|
||||||
|
* @throws SchemaException
|
||||||
*/
|
*/
|
||||||
public function d3AddLongdescMultilangColumnsToOxmanufacturers(Schema $schema)
|
public function d3AddLongdescMultilangColumnsToOxmanufacturers(Schema $schema)
|
||||||
{
|
{
|
||||||
|
@ -33,7 +33,9 @@
|
|||||||
<input type="hidden" name="catlang" value="{{ catlang }}">
|
<input type="hidden" name="catlang" value="{{ catlang }}">
|
||||||
<input type="hidden" name="editval[oxmanufacturers__d3description]" value="">
|
<input type="hidden" name="editval[oxmanufacturers__d3description]" value="">
|
||||||
|
|
||||||
{% include "include/category_text_editor.html.twig" %}
|
<div style="margin-bottom: 40px">
|
||||||
|
{% include "include/category_text_editor.html.twig" %}
|
||||||
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
{% include "bottomnaviitem.html.twig" %}
|
{% include "bottomnaviitem.html.twig" %}
|
||||||
|
@ -4,17 +4,19 @@
|
|||||||
{{ parent() }}
|
{{ parent() }}
|
||||||
|
|
||||||
{% set oManufacturer = oView.getManufacturer() %}
|
{% set oManufacturer = oView.getManufacturer() %}
|
||||||
{% set sShopURL = config.getConfigParam('sShopURL') %}
|
{% if oManufacturer && oManufacturer.getId() %}
|
||||||
{% set description = oManufacturer.d3GetLongdesc() %}
|
{% set sShopURL = config.getConfigParam('sShopURL') %}
|
||||||
|
{% set description = oManufacturer.d3GetLongdesc() %}
|
||||||
|
|
||||||
{% if oManufacturer and config.d3GetBoolModuleSettingByName('_showManufacturertextOnDetailsPage') and description|striptags|trim %}
|
{% if config.d3GetBoolModuleSettingByName('_showManufacturertextOnDetailsPage') and description|striptags|trim %}
|
||||||
<div class="col-12 col-md-6">
|
<div class="col-12 col-md-6">
|
||||||
<div id="manufacturer-collapsible" class="h4" data-bs-target="#manufacturer" data-bs-toggle="collapse" role="button" aria-expanded="false" aria-controls="manufacturer">
|
<div id="manufacturer-collapsible" class="h4" data-bs-target="#manufacturer" data-bs-toggle="collapse" role="button" aria-expanded="false" aria-controls="manufacturer">
|
||||||
{{ translate({ ident: "D3_MANUFACTURERINFO_TAB" }) }}
|
{{ translate({ ident: "D3_MANUFACTURERINFO_TAB" }) }}
|
||||||
|
</div>
|
||||||
|
<div id="manufacturer" class="collapse" aria-labelledby="manufacturer-collapsible">
|
||||||
|
{{ include(template_from_string(description)) }}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div id="manufacturer" class="collapse" aria-labelledby="manufacturer-collapsible">
|
{% endif %}
|
||||||
{{ include(template_from_string(description)) }}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endblock %}
|
{% endblock %}
|
Reference in New Issue
Block a user