From 3a4d0f2d2e578c92037fabed78df8c1a24810f7d Mon Sep 17 00:00:00 2001 From: rintisch Date: Thu, 10 Oct 2024 15:47:02 +0200 Subject: [PATCH] [TASK] Adaptions after split of ProductPlugin After the migration of switchableControllerActions in EXT:cart_products the pluginName can differ which needs to be considered. This makes the approach more generic. --- Classes/Domain/Model/Cart/DetailPageLink.php | 15 ++++- .../Model/Cart/DetailPageLinkFactory.php | 5 +- .../Cart/DetailPageLinkFactoryInterface.php | 3 +- .../Cart/ProductForm/ProductList.html | 65 ++++++++++--------- 4 files changed, 54 insertions(+), 34 deletions(-) diff --git a/Classes/Domain/Model/Cart/DetailPageLink.php b/Classes/Domain/Model/Cart/DetailPageLink.php index cb2c2322..463d171e 100644 --- a/Classes/Domain/Model/Cart/DetailPageLink.php +++ b/Classes/Domain/Model/Cart/DetailPageLink.php @@ -17,7 +17,8 @@ public function __construct( protected int $pageUid, protected string $extensionName = '', protected string $pluginName = '', - protected string $controller = '' + protected string $controller = '', + protected string $action = '', ) {} public function getPageUid(): int @@ -39,4 +40,16 @@ public function getController(): string { return $this->controller; } + public function getAction(): string + { + return $this->action; + } + + public function isActionLink(): bool + { + if ($this->pageUid && $this->extensionName && $this->pluginName && $this->controller && $this->action) { + return true; + } + return false; + } } diff --git a/Classes/Domain/Model/Cart/DetailPageLinkFactory.php b/Classes/Domain/Model/Cart/DetailPageLinkFactory.php index d4ec873c..98ad3a76 100644 --- a/Classes/Domain/Model/Cart/DetailPageLinkFactory.php +++ b/Classes/Domain/Model/Cart/DetailPageLinkFactory.php @@ -17,10 +17,11 @@ public function getDetailPageLink( int $detailPageUid, string $extensionName = '', string $pluginName = '', - string $controller = '' + string $controller = '', + string $action = '', ): ?DetailPageLink { if ($detailPageUid > 0) { - return new DetailPageLink($detailPageUid, $extensionName, $pluginName, $controller); + return new DetailPageLink($detailPageUid, $extensionName, $pluginName, $controller, $action); } return null; } diff --git a/Classes/Domain/Model/Cart/DetailPageLinkFactoryInterface.php b/Classes/Domain/Model/Cart/DetailPageLinkFactoryInterface.php index 1ef8299b..c2e086f5 100644 --- a/Classes/Domain/Model/Cart/DetailPageLinkFactoryInterface.php +++ b/Classes/Domain/Model/Cart/DetailPageLinkFactoryInterface.php @@ -17,6 +17,7 @@ public function getDetailPageLink( int $detailPageUid, string $extensionName = '', string $pluginName = '', - string $controller = '' + string $controller = '', + string $action = '' ): ?DetailPageLink; } diff --git a/Resources/Private/Partials/Cart/ProductForm/ProductList.html b/Resources/Private/Partials/Cart/ProductForm/ProductList.html index a949d110..f4229470 100644 --- a/Resources/Private/Partials/Cart/ProductForm/ProductList.html +++ b/Resources/Private/Partials/Cart/ProductForm/ProductList.html @@ -2,25 +2,41 @@ xmlns:cart="http://typo3.org/ns/Extcode/Cart/ViewHelpers" data-namespace-typo3-fluid="true"> + + + + + + {linkedTitle} + + + + + {linkedTitle} + + + + + + {linkedTitle} + + + +
- - - - {product.title} {f:if(condition:'{product.feVariant.value}',then:'- {product.feVariant.value}')} - - - - {product.title} {f:if(condition:'{product.feVariant.value}',then:'- {product.feVariant.value}')} - - + + {product.title} {f:if(condition:'{product.feVariant.value}',then:'- {product.feVariant.value}')} + +

@@ -74,21 +90,10 @@  

- - - - {variant.title} - - - - {variant.title} - - + + {variant.title} + +