src/ShopBundle/objects/db/TShopVoucher.class.php
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;
    }
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;
    }
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 ; }
return the amount of the voucher used up in previous orders.

@return float
return the amount of the voucher used up in previous orders .