request = $request; $this->scopeConfig = $scopeConfig; $this->jsonEncoder = $jsonEncoder; $this->jsonDecoder = $jsonDecoder; } /** * @param \Magento\Catalog\Block\Product\View\Gallery $subject * @param $result * @return mixed */ public function afterGetMagnifier( \Magento\Catalog\Block\Product\View\Gallery $subject, $result ) { if ($this->request->getFullActionName() != 'weltpixel_quickview_catalog_product_view') { return $result; } $result = $this->jsonDecoder->decode($result); $magnifierEnabled = $this->scopeConfig->getValue(self::XML_PATH_WELTPIXEL_QUICKVIEW_MAGNIFIER_ENABLED, \Magento\Store\Model\ScopeInterface::SCOPE_STORE); $magnifierFullscreenzoom = $this->scopeConfig->getValue(self::XML_PATH_WELTPIXEL_QUICKVIEW_MAGNIFIER_FULLSCREENZOOM, \Magento\Store\Model\ScopeInterface::SCOPE_STORE); $magnifierTop = $this->scopeConfig->getValue(self::XML_PATH_WELTPIXEL_QUICKVIEW_MAGNIFIER_TOP, \Magento\Store\Model\ScopeInterface::SCOPE_STORE); $magnifierLeft = $this->scopeConfig->getValue(self::XML_PATH_WELTPIXEL_QUICKVIEW_MAGNIFIER_LEFT, \Magento\Store\Model\ScopeInterface::SCOPE_STORE); $magnifierWidth = $this->scopeConfig->getValue(self::XML_PATH_WELTPIXEL_QUICKVIEW_MAGNIFIER_WIDTH, \Magento\Store\Model\ScopeInterface::SCOPE_STORE); $magnifierHeight = $this->scopeConfig->getValue(self::XML_PATH_WELTPIXEL_QUICKVIEW_MAGNIFIER_HEIGHT, \Magento\Store\Model\ScopeInterface::SCOPE_STORE); $magnifierEventtype = $this->scopeConfig->getValue(self::XML_PATH_WELTPIXEL_QUICKVIEW_MAGNIFIER_EVENTTYPE, \Magento\Store\Model\ScopeInterface::SCOPE_STORE); $result['enabled'] = $magnifierEnabled; $result['fullscreenzoom'] = $magnifierFullscreenzoom; $result['top'] = $magnifierTop; $result['left'] = $magnifierLeft; $result['width'] = $magnifierWidth; $result['height'] = $magnifierHeight; $result['eventType'] = $magnifierEventtype; return $this->jsonEncoder->encode($result); } }