localeDate = $localeDate; } /** * @return bool|float */ public function getValue() { if (null === $this->value) { $this->value = false; $specialPrice = $this->getSpecialPrice(); if ($specialPrice !== null && $specialPrice !== false && $this->isScopeDateInInterval()) { $this->value = (float) $specialPrice; } } return $this->value; } /** * Returns special price * * @return float */ public function getSpecialPrice() { $specialPrice = $this->product->getSpecialPrice(); if ($specialPrice !== null && $specialPrice !== false && !$this->isPercentageDiscount()) { $specialPrice = $this->priceCurrency->convertAndRound($specialPrice); } return $specialPrice; } /** * Returns starting date of the special price * * @return mixed */ public function getSpecialFromDate() { return $this->product->getSpecialFromDate(); } /** * Returns end date of the special price * * @return mixed */ public function getSpecialToDate() { return $this->product->getSpecialToDate(); } /** * @return bool */ public function isScopeDateInInterval() { return $this->localeDate->isScopeDateInInterval( $this->product->getStore(), $this->getSpecialFromDate(), $this->getSpecialToDate() ); } /** * @return bool */ public function isPercentageDiscount() { return false; } }