dateTime = $dateTime; $this->storeManager = $storeManager; $this->customerSession = $customerSession; $this->resourceRuleFactory = $catalogRuleResourceFactory; } /** * Returns catalog rule value * * @return float|boolean */ public function getValue() { if (null === $this->value) { if ($this->product->hasData(self::PRICE_CODE)) { $this->value = (float)$this->product->getData(self::PRICE_CODE) ?: false; } else { $this->value = $this->getRuleResource() ->getRulePrice( $this->dateTime->scopeDate($this->storeManager->getStore()->getId()), $this->storeManager->getStore()->getWebsiteId(), $this->customerSession->getCustomerGroupId(), $this->product->getId() ); $this->value = $this->value ? (float)$this->value : false; } if ($this->value) { $this->value = $this->priceCurrency->convertAndRound($this->value); } } return $this->value; } /** * @return Rule * @deprecated 100.1.1 */ private function getRuleResource() { if (null === $this->ruleResource) { $this->ruleResource = ObjectManager::getInstance()->get(Rule::class); } return $this->ruleResource; } }