canManageCookie = $canManageCookie; $this->config = $config; } /** * Change magento restriction mode. * * @param \Magento\Cookie\Helper\Cookie $subject * @param string|null|bool $result * @return bool */ public function afterIsCookieRestrictionModeEnabled(Cookie $subject, $result) { if ($this->config->isModuleEnabled()) { return $this->canManageCookie->execute(); } return $result; } }