src/ShopCurrencyBundle/pkgShop/objects/db/TPkgShopCurrency_ShopVoucher.class.php
protected function CommitVoucherUseForCurrentUserPreSaveHook(&$aData)
    {
        // value used is converted to the base currency - euro
        $oCurrency = TdbPkgShopCurrency::GetBaseCurrency();
        $oActive = TdbPkgShopCurrency::GetActiveInstance();
        $aData['value_used_in_order_currency'] = $aData['value_used'];
        if (false !== $oCurrency) {
            $aData['pkg_shop_currency_id'] = $oCurrency->id;
        }
        if ($oCurrency && $oActive && $oActive->id != $oCurrency->id) {
            $aData['pkg_shop_currency_id'] = $oActive->id;
            $aData['value_used'] = round($oCurrency->Convert($aData['value_used'], $oActive), 2);
        }
    }
protected function CommitVoucherUseForCurrentUserPreSaveHook(&$aData)
    {
        // value used is converted to the base currency - euro
        $oCurrency = TdbPkgShopCurrency::GetBaseCurrency();
        $oActive = TdbPkgShopCurrency::GetActiveInstance();
        $aData['value_used_in_order_currency'] = $aData['value_used'];
        if (false !== $oCurrency) {
            $aData['pkg_shop_currency_id'] = $oCurrency->id;
        }
        if ($oCurrency && $oActive && $oActive->id != $oCurrency->id) {
            $aData['pkg_shop_currency_id'] = $oActive->id;
            $aData['value_used'] = round($oCurrency->Convert($aData['value_used'], $oActive), 2);
        }
    }
protected function CommitVoucherUseForCurrentUserPreSaveHook ( & $ aData ) { // value used is converted to the base currency - euro $ oCurrency = TdbPkgShopCurrency :: GetBaseCurrency ( ) ; $ oActive = TdbPkgShopCurrency :: GetActiveInstance ( ) ; $ aData [ 'value_used_in_order_currency' ] = $ aData [ 'value_used' ] ; if ( false !== $ oCurrency ) { $ aData [ 'pkg_shop_currency_id' ] = $ oCurrency -> id ; } if ( $ oCurrency && $ oActive && $ oActive -> id != $ oCurrency -> id ) { $ aData [ 'pkg_shop_currency_id' ] = $ oActive -> id ; $ aData [ 'value_used' ] = round ( $ oCurrency -> Convert ( $ aData [ 'value_used' ] , $ oActive ) , 2 ) ; } }
method can be used to process the use data before the commit is called
we use it here to convert the value of the voucher used back to the base currency (since that is what we want to store.

@param array $aData
method can be used to process the use data before the commit is called we use it here to convert the value of the voucher used back to the base currency ( since that is what we want to store .