From 17a77bbf4c634b385bc174dc64df2c16f0d76bac Mon Sep 17 00:00:00 2001 From: MaxBUhe Date: Tue, 30 Jul 2024 14:54:03 +0200 Subject: [PATCH] [Unknown-State] first base for it came formerly from an OS-Ticket but ticket got canceled from the customer --- .../d3GtmBasketComponentExtension.php | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/Modules/Application/Component/d3GtmBasketComponentExtension.php b/Modules/Application/Component/d3GtmBasketComponentExtension.php index 609044a..bbe7718 100644 --- a/Modules/Application/Component/d3GtmBasketComponentExtension.php +++ b/Modules/Application/Component/d3GtmBasketComponentExtension.php @@ -57,6 +57,26 @@ class d3GtmBasketComponentExtension extends d3GtmBasketComponentExtension_parent return (bool) $decision; } + public function getRemoveFromBasketDecision() :bool + { + $decision = Registry::getSession()->getVariable('d3GtmRemoveFromBasketTrigger'); + + Registry::getSession()->setVariable('d3GtmRemoveFromBasketTrigger', false); + + return (bool) $decision; + } + + protected function _getItems($sProductId = null, $dAmount = null, $aSel = null, $aPersParam = null, $blOverride = false) + { + $aProducts = parent::_getItems($sProductId, $dAmount, $aSel, $aPersParam, $blOverride); + + if (is_array($aProducts) && count($aProducts)) { + Registry::getSession()->setVariable('d3GtmRemoveFromBasketTrigger', true); + } + + return $return; + } + /** * @return Article|null */