src/ShopBundle/objects/TShopBasket/TShopBasketVoucherCoreList.class.php
public function GetVoucherValue($bSponsoredVouchers = false)
    {
        $dValue = 0;
        $oBasket = TShopBasket::GetInstance();

        $iTmpPointer = $this->getItemPointer();
        $this->GoToStart();
        $maxValueShippingCostAdjustment = true === $bSponsoredVouchers ? $oBasket->dCostShipping : 0;
        while ($oVoucher = $this->Next()) {
            if (($bSponsoredVouchers && $oVoucher->IsSponsored()) || (false == $bSponsoredVouchers && false == $oVoucher->IsSponsored())) {
                $dMaxValue = ($oBasket->dCostArticlesTotalAfterDiscounts + $maxValueShippingCostAdjustment) - $dValue;
                $dValue += $oVoucher->GetValue(true, $dMaxValue, $bSponsoredVouchers);
            }
        }

        $this->setItemPointer($iTmpPointer);

        return $dValue;
    }
public function GetVoucherValue($bSponsoredVouchers = false)
    {
        $dValue = 0;
        $oBasket = TShopBasket::GetInstance();

        $iTmpPointer = $this->getItemPointer();
        $this->GoToStart();
        $maxValueShippingCostAdjustment = true === $bSponsoredVouchers ? $oBasket->dCostShipping : 0;
        while ($oVoucher = $this->Next()) {
            if (($bSponsoredVouchers && $oVoucher->IsSponsored()) || (false == $bSponsoredVouchers && false == $oVoucher->IsSponsored())) {
                $dMaxValue = ($oBasket->dCostArticlesTotalAfterDiscounts + $maxValueShippingCostAdjustment) - $dValue;
                $dValue += $oVoucher->GetValue(true, $dMaxValue, $bSponsoredVouchers);
            }
        }

        $this->setItemPointer($iTmpPointer);

        return $dValue;
    }
public function GetVoucherValue ( $ bSponsoredVouchers = false ) { $ dValue = 0 ; $ oBasket = TShopBasket :: GetInstance ( ) ; $ iTmpPointer = $ this -> getItemPointer ( ) ; $ this -> GoToStart ( ) ; $ maxValueShippingCostAdjustment = true === $ bSponsoredVouchers ? $ oBasket -> dCostShipping : 0 ; while ( $ oVoucher = $ this -> Next ( ) ) { if ( ( $ bSponsoredVouchers && $ oVoucher -> IsSponsored ( ) ) || ( false == $ bSponsoredVouchers && false == $ oVoucher -> IsSponsored ( ) ) ) { $ dMaxValue = ( $ oBasket -> dCostArticlesTotalAfterDiscounts + $ maxValueShippingCostAdjustment ) - $ dValue ; $ dValue += $ oVoucher -> GetValue ( true , $ dMaxValue , $ bSponsoredVouchers ) ; } } $ this -> setItemPointer ( $ iTmpPointer ) ; return $ dValue ; }
return the total voucher value for all active vouchers. note that the method will fetch the current basket
using the baskets singleton factory.

@param bool $bSponsoredVouchers - set to true: only sponsored vouchers, false only none sponsored vouchers

@return float
return the total voucher value for all active vouchers . note that the method will fetch the current basket using the baskets singleton factory .