[Added] pseudo field for output

oxcategories__oxlongdesc into the oxmanufacturers object, so existing template structures can immediately catch it up
This commit is contained in:
MaxBuhe01 2024-11-05 16:13:03 +01:00
parent fc0dbdb804
commit 08a81e0eb4
2 changed files with 36 additions and 7 deletions

View File

@ -0,0 +1,25 @@
<?php
declare(strict_types=1);
namespace D3\ManufacturerInformation\Modules\Application\Model;
use D3\ManufacturerInformation\Application\Model\Constants;
use OxidEsales\Eshop\Application\Model\Manufacturer;
use OxidEsales\Eshop\Application\Model\ManufacturerList;
use OxidEsales\Eshop\Core\Field;
class ManufacturerInfoList extends ManufacturerInfoList_parent
{
/**
* @param Manufacturer|D3ManufacturerLongDesc $oManufacturer
* @return void
*/
protected function _addCategoryFields($oManufacturer)
{
parent::_addCategoryFields($oManufacturer);
$oManufacturer->oxcategories__oxlongdesc = new Field($oManufacturer->getFieldData(Constants::D3_OXMANUFACTURERS_LONGDESC_FIELDNAME), Field::T_RAW);
}
}

View File

@ -13,12 +13,14 @@
declare(strict_types=1); declare(strict_types=1);
use D3\ManufacturerInformation\Application\Controller\Admin\ManufacturerInfoLongdesc; use D3\ManufacturerInformation\Application\Controller\Admin\ManufacturerInfoLongdesc;
use D3\ManufacturerInformation\Application\Model\Constants; use D3\ManufacturerInformation\Application\Model\Constants;
use D3\ManufacturerInformation\Modules\Application\Model\D3ManufacturerLongDesc; use D3\ManufacturerInformation\Modules\Application\Model\D3ManufacturerLongDesc;
use OxidEsales\Eshop\Application\Model\Manufacturer as OEManufacturer; use D3\ManufacturerInformation\Modules\Application\Model\ManufacturerInfoList;
use OxidEsales\Eshop\Application\Model\Manufacturer as OEManufacturer;
use OxidEsales\Eshop\Application\Model\ManufacturerList as OEManufacturerList;
$sMetadataVersion = '2.1'; $sMetadataVersion = '2.1';
$sModuleId = Constants::OXID_MODULE_ID; $sModuleId = Constants::OXID_MODULE_ID;
$logo = '<img src="https://logos.oxidmodule.com/d3logo.svg" alt="(D3)" style="height:1em;width:1em">'; $logo = '<img src="https://logos.oxidmodule.com/d3logo.svg" alt="(D3)" style="height:1em;width:1em">';
@ -42,7 +44,9 @@ $aModule = [
"d3manufacturerinfolongdesc" => ManufacturerInfoLongdesc::class "d3manufacturerinfolongdesc" => ManufacturerInfoLongdesc::class
], ],
'extend' => [ 'extend' => [
OEManufacturer::class => D3ManufacturerLongDesc::class // Model
OEManufacturer::class => D3ManufacturerLongDesc::class,
OEManufacturerList::class => ManufacturerInfoList::class
], ],
'events' => [ 'events' => [
// 'onActivate' => '\D3\ThisModule\Setup\Events::onActivate', // 'onActivate' => '\D3\ThisModule\Setup\Events::onActivate',