Get price

If no "price" value has been set, this method will
set and return a default "price" value,
if any such value is available

@see getDefaultPrice()

@return string|null price or null if no price has been set
426599
public function getPrice() : ?string 
    {
        if ( ! $this->hasPrice()) {
            $this->setPrice($this->getDefaultPrice());
        }
        return $this->price;
    }
297420
public function getValue()
    {
        if (isset($this->value) && $this->value !== null) {
            return $this->value;
        } elseif (isset($this->element['default'])) {
            return $this->element['default'];
        } else {
            return '';
        }
    }
720031
protected function getPriceTypeObject()
    {
        $arValuePartList = explode('|', $this->sValue);
        $sPriceTypeCode = array_pop($arValuePartList);

        $obPriceType = PriceTypeHelper::instance()->findByCode($sPriceTypeCode);

        return $obPriceType;
    }
343584
public function getOrderWrappingPrice()
    {
        if ($this->_oWrappingPrice != null) {
            return $this->_oWrappingPrice;
        }

        $this->_oWrappingPrice = oxNew(\OxidEsales\Eshop\Core\Price::class);
        $this->_oWrappingPrice->setBruttoPriceMode();
        $this->_oWrappingPrice->setPrice($this->oxorder__oxwrapcost->value, $this->oxorder__oxwrapvat->value);

        return $this->_oWrappingPrice;
    }
1088590
public function getDiscountPrice()
    {
        $price = $this->price;
        if (!empty($price)) {
            $discountPrice = $price->discountPrice;
        }
        else $discountPrice = 0;

        return $discountPrice;
    }
643488
public function getOldPrice()
    {
        $price = $this->price;
        if (\Yii::$app->getModule('shop')->enableCurrencyConversion) {
            $price = $price * Currency::currentCurrency();
        }
        if (\Yii::$app->getModule('shop')->enablePriceRounding) {
            $price = floor($price);
        }

        return $price;
    }
45289
protected function getPriceValueAttribute()
    {
        if (empty($this->iActivePriceType)) {
            $fPrice = $this->getAttribute('price_value');
        } else {
            $fPrice = array_get($this->price_list, $this->iActivePriceType.'.price');
        }

        $fPrice = CurrencyHelper::instance()->convert($fPrice, $this->getActiveCurrency());

        return $fPrice;
    }
85853
public function getDefault()
    {
        if ($this->reflection->isDefaultValueAvailable()
            and $default = $this->reflection->getDefaultValue()
        ) {
            if (is_scalar($default)) {
                return $default;
            } else {
                return $this->tostring($default);
            }
        }
        if ($this->reflection->isArray()) {
            return '[]';
        }
        if ($this->isPassedByReference()) {
            return 'null';
        } elseif ($this->reflection->getClass()) {
            // This gets injected as a new instance.
            return null;
        }
        $type = $this->getType();
        if (!$type) {
            $type = $this->extractParameterData();
        }
        // Guesstimated values:
        switch ($type) {
            case 'int': case 'integer': case 'float':
                return 0;
            case 'string':
                return "''";
            case 'array':
                return '[]';
        }
        return null;
    }
696165
public function getPrice()
    {
        if ($this->_isPriceViewModeNetto()) {
            $dPrice = $this->getWrappingPrice()->getNettoPrice();
        } else {
            $dPrice = $this->getWrappingPrice()->getBruttoPrice();
        }

        return $dPrice;
    }
561047
public function getFPrice()
    {
        if ($this->_fPrice == null) {
            $this->_fPrice = false;
            if ($dArtPrice = $this->getPrice()) {
                $myLang = \OxidEsales\Eshop\Core\Registry::getLang();
                $oThisCurr = $this->getPriceAlarmCurrency();
                $this->_fPrice = $myLang->formatCurrency($dArtPrice, $oThisCurr);
            }
        }

        return $this->_fPrice;
    }
661328
public function getDefaultValue()
    {
        return is_array($this->default_value) ? $this->default_value : [
            Carbon::now()->subWeek()->format('Y-m-d'),
            Carbon::now()->format('Y-m-d'),
        ];
    }
1356631
public function getFTPrice()
    {
        // module
        if ($oPrice = $this->getTPrice()) {
            if ($dPrice = $this->_getPriceForView($oPrice)) {
                return \OxidEsales\Eshop\Core\Registry::getLang()->formatCurrency($dPrice);
            }
        }
    }
1204318
public function getOrderPaymentPrice()
    {
        if ($this->_oPaymentPrice != null) {
            return $this->_oPaymentPrice;
        }

        $this->_oPaymentPrice = oxNew(\OxidEsales\Eshop\Core\Price::class);
        $this->_oPaymentPrice->setBruttoPriceMode();
        $this->_oPaymentPrice->setPrice($this->oxorder__oxpaycost->value, $this->oxorder__oxpayvat->value);

        return $this->_oPaymentPrice;
    }
150131
public function getValue()
    {
        if (null == $this->is_valid && null != $this->user_value) {
            $this->validate();
        }
        if (null !== $this->user_value && $this->is_valid) {
            if ('' === $this->user_value && true === $this->null_on_empty) {
                return null;
            }
            return $this->user_value;
        } else {
            if ('' === $this->default_value && true === $this->null_on_empty) {
                return null;
            }
            return $this->default_value;
        }
    }
1199963
public function GetTotalPrice()
    {
        if (is_null($this->dPrice)) {
            $this->dPrice = 0;
            $iPointer = $this->getItemPointer();
            $this->GoToStart();
            while ($oItem = &$this->Next()) {
                $this->dPrice += $oItem->GetPrice();
            }
            $this->setItemPointer($iPointer);
        }

        return $this->dPrice;
    }
767850
public function getValue() : ?string 
    {
        if ( ! $this->hasValue()) {
            $this->setValue($this->getDefaultValue());
        }
        return $this->value;
    }
564484
public function getPhpDefaultValue()
    {
        if (null === $this->defaultValue) {
            return null;
        }

        if ($this->defaultValue->isExpression()) {
            throw new EngineException('Cannot get PHP version of default value for default value EXPRESSION.');
        }

        if (in_array($this->mappingType, [ PropelTypes::BOOLEAN, PropelTypes::BOOLEAN_EMU ])) {
            return $this->booleanValue($this->defaultValue->getValue());
        }

        if (PropelTypes::PHP_ARRAY === $this->mappingType) {
            return $this->getDefaultValueForArray($this->defaultValue->getValue());
        }
        if (PropelTypes::SET === $this->mappingType) {
            return $this->getDefaultValueForSet($this->defaultValue->getValue());
        }

        return $this->defaultValue->getValue();
    }