From 7097c8d35651ed6b114d9aa78c9d5a56fd3076c6 Mon Sep 17 00:00:00 2001 From: MarkusGaertner Date: Tue, 15 Aug 2023 11:52:46 +0200 Subject: [PATCH] extend Manufacturer --- Modules/Application/Model/Manufacturer.php | 44 ++++++++++++++++++++++ metadata.php | 3 ++ 2 files changed, 47 insertions(+) create mode 100644 Modules/Application/Model/Manufacturer.php diff --git a/Modules/Application/Model/Manufacturer.php b/Modules/Application/Model/Manufacturer.php new file mode 100644 index 0000000..8ecae9a --- /dev/null +++ b/Modules/Application/Model/Manufacturer.php @@ -0,0 +1,44 @@ + -1){ + $splitCatArray = + array_values( + array_filter( + explode( + '/', + trim( + parse_url( + $this->getLink(), + 5 + ) + ) + ) + ) + ); + + if ($splitCatArray[$indexOfArray]){ + return $splitCatArray[$indexOfArray]; + }else{ + return ""; + } + } + + return + trim( + parse_url( + $this->getLink(), + 5 + ) + ); + } +} \ No newline at end of file diff --git a/metadata.php b/metadata.php index b0191d8..d942312 100755 --- a/metadata.php +++ b/metadata.php @@ -3,10 +3,12 @@ use D3\GoogleAnalytics4\Modules\Application\Controller\BasketController; use D3\GoogleAnalytics4\Modules\Application\Model\Basket as Basket; use D3\GoogleAnalytics4\Modules\Application\Model\Category as Category; +use D3\GoogleAnalytics4\Modules\Application\Model\Manufacturer as Manufacturer; use D3\GoogleAnalytics4\Modules\Core\ViewConfig; use OxidEsales\Eshop\Application\Controller\BasketController as OEBasketController; use OxidEsales\Eshop\Application\Model\Basket as OEBasket; use OxidEsales\Eshop\Application\Model\Category as OECategory; +use OxidEsales\Eshop\Application\Model\Manufacturer as OEManufacturer; use OxidEsales\Eshop\Core\ViewConfig as OEViewConfig; $sMetadataVersion = '2.1'; @@ -31,6 +33,7 @@ $aModule = [ 'extend' => [ OEViewConfig::class => ViewConfig::class, OECategory::class => Category::class, + OEManufacturer::class => Manufacturer::class, OEBasket::class => Basket::class, OEBasketController::class => BasketController::class ],