/** * Update options of the product view page * * @param \Magento\Framework\Event\Observer $observer * @return $this */ public function updateProductOptions(\Magento\Framework\Event\Observer $observer) { if (!$this->_weeeData->isEnabled()) { return $this; } $response = $observer->getEvent()->getResponseObject(); $options = $response->getAdditionalOptions(); $_product = $this->_registry->registry('current_product'); if (!$_product) { return $this; } $options['oldPlusDisposition'] = $this->_weeeData->getOriginalAmount($_product); $options['plusDisposition'] = $this->_weeeData->getAmount($_product); // Exclude Weee amount from excluding tax amount if (!$this->_weeeData->typeOfDisplay(array(Tax::DISPLAY_INCL, Tax::DISPLAY_INCL_DESCR))) { $options['exclDisposition'] = true; } $response->setAdditionalOptions($options); return $this; }