Returns the value of the discount - takes the current basket and user into consideration.

@return float
974651
public function GetValue()
    {
        $dValue = $this->fieldValue;
        $oBasket = TShopBasket::GetInstance();
        $dBasketValueApplicableForDiscount = $oBasket->GetBasketSumForDiscount($this);
        $dValue = $this->GetValueForBasketValue($dBasketValueApplicableForDiscount);

        return $dValue;
    }
1006515
public function getPaymorrowTotalVatAmount()
    {
        /** @var OxpsPaymorrowOxBasket|oxBasket $this */

        // Products VAT
        $dTotalVat = (double) array_sum( (array) $this->getProductVats( false ) );

        // Get cost and add costs VATs
        $aCosts = (array) $this->getCosts();

        foreach ( $aCosts as $oPrice ) {
            $dTotalVat += (double) $this->_getVatForValidPrice( $oPrice );
        }

        // Add surcharge VAT amount in case it is not yet included in basket
        $dTotalVat += (double) $this->_getVatForValidPrice( $this->_getPaymentMethodSurcharge() );

        return $dTotalVat;
    }
1305776
public function getTotalDiscountSum()
    {
        $dPrice = 0;
        // subtracting total discount
        if ($oPrice = $this->getTotalDiscount()) {
            $dPrice += $oPrice->getPrice();
        }

        if ($oVoucherPrice = $this->getVoucherDiscount()) {
            $dPrice += $oVoucherPrice->getPrice();
        }

        return $dPrice;
    }
68938
public function getPrice()
    {
        $price = $this->BasePrice;
                
        // Check for customisations that modify price
        foreach ($this->getCustomisations() as $item) {
            $price += ($item->Price) ? $item->Price : 0;
        }
        
        return $price;
    }
473025
public function getPriceForPayment()
    {
        $dPrice = $this->getDiscountedProductsBruttoPrice();
        //#1905 not discounted products should be included in payment amount calculation
        if ($oPriceList = $this->getNotDiscountProductsPrice()) {
            $dPrice += $oPriceList->getBruttoSum();
        }

        // adding delivery price to final price
        if ($oDeliveryPrice = $this->_aCosts['oxdelivery']) {
            $dPrice += $oDeliveryPrice->getBruttoPrice();
        }

        return $dPrice;
    }
512703
public function GetValuePreviouslyUsed()
    {
        // we have to make sure that is value is accurate... so we will fetch it from database every time
        // performance should not be a big issue, since it only affects users that include a voucher in their basket
        $dValueUsed = 0;
        $query = "SELECT SUM(`value_used`) AS totalused
                  FROM `shop_voucher_use`
            INNER JOIN `shop_order` ON `shop_voucher_use`.`shop_order_id` = `shop_order`.`id`
                 WHERE `shop_voucher_id` = '".MySqlLegacySupport::getInstance()->real_escape_string($this->id)."'
                   AND `shop_order`.`canceled` = '0'
                 ";
        if ($aValue = MySqlLegacySupport::getInstance()->fetch_assoc(MySqlLegacySupport::getInstance()->query($query))) {
            if (null !== $aValue['totalused']) {
                $dValueUsed = $aValue['totalused'];
            }
        }

        return $dValueUsed;
    }
556909
public function getFPrice()
    {
        $dPrice = $this->getPrice();

        return \OxidEsales\Eshop\Core\Registry::getLang()->formatCurrency($dPrice, \OxidEsales\Eshop\Core\Registry::getConfig()->getActShopCurrencyObject());
    }
838896
public function get()
	{
		if( !isset( $this->baskets[$this->type] ) )
		{
			$this->baskets[$this->type] = $this->manager->getSession( $this->type );
			$this->checkLocale( $this->baskets[$this->type]->getLocale(), $this->type );
		}

		return $this->baskets[$this->type];
	}
841678
public function getBidPrice()
    {
        if ($this->_sBidPrice === null) {
            $this->_sBidPrice = false;

            $aParams = $this->_getParams();
            $oCur = \OxidEsales\Eshop\Core\Registry::getConfig()->getActShopCurrencyObject();
            $iPrice = \OxidEsales\Eshop\Core\Registry::getUtils()->currency2Float($aParams['price']);
            $this->_sBidPrice = \OxidEsales\Eshop\Core\Registry::getLang()->formatCurrency($iPrice, $oCur);
        }

        return $this->_sBidPrice;
    }
250028
public function getPurchasedAt() : ?int 
    {
        if ( ! $this->hasPurchasedAt()) {
            $this->setPurchasedAt($this->getDefaultPurchasedAt());
        }
        return $this->purchasedAt;
    }
745841
public function usediscount()
    {
        $this->extend("onBeforeUseDiscount");

        $code_to_search = $this->request->param("ID");
        $code = false;

        if (!$code_to_search) {
            return $this->httpError(404, "Page not found");
        }

        // First check if the discount is already added (so we don't
        // query the DB if we don't have to).
        if (!$this->discount || ($this->discount && $this->discount->Code != $code_to_search)) {
            $codes = Discount::get()
                ->filter("Code", $code_to_search)
                ->exclude("Expires:LessThan", date("Y-m-d"));

            if ($codes->exists()) {
                $code = $codes->first();
                $this->discount = $code;
                $this->save();
            }
        } elseif ($this->discount && $this->discount->Code == $code_to_search) {
            $code = $this->discount;
        }

        return $this
            ->customise(array(
                "Discount" => $code
            ))->renderWith(array(
                'ShoppingCart_discount',
                'Checkout',
                'Page'
            ));
    }
597345
public function getSumPrice()
	{
		$price = clone $this->_price;

		$price->setValue( $price->getValue() * $this->_values['quantity'] );
		$price->setCosts( $price->getCosts() * $this->_values['quantity'] );
		$price->setRebate( $price->getRebate() * $this->_values['quantity'] );

		return $price;
	}
267876
public function getCost() {
        $totalCost = 0;
        if (Yii::$app->user->isGuest) {
            //Gets products from session
            $session = Yii::$app->session;
            $products = $session[self::SESSION_KEY];

            if (!empty($products)) {
                foreach ($products as $product) {

                    if (!empty($product['combinationId'])) {
                        $combination = Combination::findOne($product['combinationId']);
                        if (!empty($combination)) $totalCost += $combination->price->discountPriceFloor * $product['count'];
                    } else {
                        $productFromDb = Product::findOne($product['id']);
                        if (!empty($productFromDb))
                            $totalCost += $productFromDb->price->discountPriceFloor * $product['count'];
                    }

                    if (!empty($product['additionalProducts'])) {
                        foreach ($product['additionalProducts'] as $additionalProduct) {
                            if ((int)$additionalProduct['productId']) {
                                $product = Product::findOne($additionalProduct['productId']);
                                if (!empty($product)) {
                                    $totalCost += $product->price->discountPriceFloor * $additionalProduct['number'];
                                }
                            }
                        }
                    }
                }
            }
        } else {
            //Gets products from incomplete order in DB
            $order = Order::find()
                ->where(['user_id' => Yii::$app->user->id, 'status' => OrderStatus::STATUS_INCOMPLETE])
                ->one();
            if (!empty($order)) {
                $orderProducts = OrderProduct::find()->where(['order_id' => $order->id])->all();
                if (!empty($orderProducts)) {
                    foreach ($orderProducts as $product) {
                        if (\Yii::$app->getModule('shop')->enableCombinations && !empty($product->combination)) {
                            $totalCost += $product->count * $product->combination->price->discountPriceFloor;
                        } else {
                            $totalCost += $product->count * $product->product->price->discountPriceFloor;
                        }
                        if (!empty($product->orderProductAdditionalProducts)) {
                            foreach ($product->orderProductAdditionalProducts as $orderProductAdditionalProduct) {
                                $totalCost += $orderProductAdditionalProduct->additionalProduct->price->discountPriceFloor *
                                    $orderProductAdditionalProduct->number;
                            }
                        }
                    }
                }
            }
        }
        return $totalCost;
    }
1145416
public function getFPrice()
    {
        $myConfig = \OxidEsales\Eshop\Core\Registry::getConfig();
        // 0002030 No need to return price if it disabled for better performance.
        if (!$myConfig->getConfigParam('bl_perfLoadPrice')) {
            return;
        }

        if ($this->_sFPrice) {
            return $this->_sFPrice;
        }

        $sFromPrefix = '';

        if (!$this->_isFixedPrice()) {
            $sFromPrefix = \OxidEsales\Eshop\Core\Registry::getLang()->translateString('PRICE_FROM') . ' ';
        }

        $dMinPrice = $this->getMinDPrice();
        $sFMinPrice = \OxidEsales\Eshop\Core\Registry::getLang()->formatCurrency($dMinPrice);
        $sCurrency = ' ' . \OxidEsales\Eshop\Core\Registry::getConfig()->getActShopCurrencyObject()->sign;
        $this->_sFPrice = $sFromPrefix . $sFMinPrice . $sCurrency;

        return $this->_sFPrice;
    }
1127081
public function getMinOrderPrice()
    {
        if ($this->_sMinOrderPrice === null && $this->isLowOrderPrice()) {
            $minOrderPrice = \OxidEsales\Eshop\Core\Price::getPriceInActCurrency(\OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('iMinOrderPrice'));
            $this->_sMinOrderPrice = \OxidEsales\Eshop\Core\Registry::getLang()->formatCurrency($minOrderPrice);
        }

        return $this->_sMinOrderPrice;
    }
821716
public function getGrandTotalAttribute()
    {
        if (!$this->deliveryOption) return $this->total;

        return (float) round($this->total + $this->deliveryOption->price, 2);
    }
621003
public function getIPaymentBasket()
    {
        if ($this->_dIPaymentBasket === null) {
            $this->_dIPaymentBasket = $this->getBasket()->getPrice()->getBruttoPrice() * 100;
        }

        return $this->_dIPaymentBasket;
    }