VirtueMart
3.2.14.9808
|
Public Member Functions | |
setPriceArray () | |
getCurrencyForDisplay ($currencyId=0) | |
priceDisplay ($price, $currencyId=0, $quantity=1.0, $inToShopCurrency=false, $nb=-1) | |
roundForDisplay ($price, $currencyId=0, $quantity=1.0, $inToShopCurrency=false, $nb=-1) | |
getFormattedCurrency ($nb, $nbDecimal=-1) | |
getFormattedNumber ($n, $dec) | |
createPriceDiv ($name, $description, $product_price, $priceOnly=false, $switchSequel=false, $quantity=1.0, $forceNoLabel=false, $force=false) | |
convertCurrencyTo ($currency, $price, $shop=true) | |
ensureUsingCurrencyCode ($curr) | |
getCurrencyIdByField ($value=0, $fieldName='currency_code_3') | |
formatNumber ($number, $decimals=2, $decimal_point= '.', $thousand_separator= ' ') | |
getSymbol () | |
getId () | |
Static Public Member Functions | |
static | getInstance ($currencyId=0, $vendorId=0) |
Public Attributes | |
$_priceConfig = array() | |
$exchangeRateShopper = 1.0 | |
$_vendorCurrency = 0 | |
$_vendorCurrency_code_3 = 0 | |
$_vendorCurrency_numeric = 0 | |
Static Public Attributes | |
static | $_instance = array() |
static | $priceNames |
Private Member Functions | |
__construct ($vendorId=0) | |
setCurrencyDisplayToStyleStr ($style) | |
Private Attributes | |
$_currencyConverter | |
$_currency_id = '0' | |
$_symbol = 'udef' | |
$_nbDecimal = 2 | |
$_decimal = ',' | |
$_thousands = ' ' | |
$_positivePos = '{number}{symbol}' | |
$_negativePos = '{sign}{number}{symbol}' | |
$_numeric_code = 0 | |
|
private |
CurrencyDisplay::convertCurrencyTo | ( | $currency, | |
$price, | |||
$shop = true |
|||
) |
unknown_type | $currency | |
unknown_type | $price | |
unknown_type | $shop |
CurrencyDisplay::createPriceDiv | ( | $name, | |
$description, | |||
$product_price, | |||
$priceOnly = false , |
|||
$switchSequel = false , |
|||
$quantity = 1.0 , |
|||
$forceNoLabel = false , |
|||
$force = false |
|||
) |
function to create a div to show the prices, is necessary for JS
string | name of the price |
String | description key |
array | the prices of the product return a div for prices which is visible according to config and have all ids and class set |
CurrencyDisplay::ensureUsingCurrencyCode | ( | $curr | ) |
Changes the virtuemart_currency_id into the right currency_code For exampel 47 => EUR
CurrencyDisplay::formatNumber | ( | $number, | |
$decimals = 2 , |
|||
$decimal_point = '.' , |
|||
$thousand_separator = ' ' |
|||
) |
double | $number | |
int | $decimals | |
string | $thousand_separator | |
string | $decimal_point |
CurrencyDisplay::getCurrencyForDisplay | ( | $currencyId = 0 | ) |
getCurrencyForDisplay: get The actual displayed Currency Use this only in a view, plugin or modul, never in a model
integer | $currencyId | return integer $currencyId: displayed Currency |
CurrencyDisplay::getCurrencyIdByField | ( | $value = 0 , |
|
$fieldName = 'currency_code_3' |
|||
) |
Changes the currency_code into the right virtuemart_currency_id For exampel 'currency_code_3' : EUR => 47
CurrencyDisplay::getFormattedCurrency | ( | $nb, | |
$nbDecimal = -1 |
|||
) |
Format, Round and Display Value
val | number |
CurrencyDisplay::getFormattedNumber | ( | $n, | |
$dec | |||
) |
CurrencyDisplay::getId | ( | ) |
Return the currency ID
|
static |
Gives back the format of the currency, gets $style if none is set, with the currency Id, when nothing is found it tries the vendorId. When no param is set, you get the format of the mainvendor
int | $currencyId | Id of the currency |
int | $vendorId | Id of the vendor |
string | $style | The vendor_currency_display_code FORMAT: 1: id, 2: CurrencySymbol, 3: NumberOfDecimalsAfterDecimalSymbol, 4: DecimalSymbol, 5: Thousands separator 6: Currency symbol position with Positive values : 7: Currency symbol position with Negative values : |
EXAMPLE: ||€|2|,||1|8
CurrencyDisplay::getSymbol | ( | ) |
Return the currency symbol
CurrencyDisplay::priceDisplay | ( | $price, | |
$currencyId = 0 , |
|||
$quantity = 1.0 , |
|||
$inToShopCurrency = false , |
|||
$nb = -1 |
|||
) |
This function is for the gui only! Use this only in a view, plugin or modul, never in a model TODO for vm3 remove quantity option
float | $price | |
integer | $currencyId | return string formatted price |
CurrencyDisplay::roundForDisplay | ( | $price, | |
$currencyId = 0 , |
|||
$quantity = 1.0 , |
|||
$inToShopCurrency = false , |
|||
$nb = -1 |
|||
) |
|
private |
Parse the given currency display string into the currency diplsy values.
This function takes the currency style string as saved in the vendor record and parses it into its appropriate values. An example style string would be 1|€|2|,|.|0|0
String | $currencyStyle | String containing the currency display settings |
CurrencyDisplay::setPriceArray | ( | ) |
This function sets an array, which holds the information if a price is to be shown and the number of rounding digits
|
private |
|
private |
|
private |
|
static |
|
private |
|
private |
|
private |
|
private |
CurrencyDisplay::$_priceConfig = array() |
|
private |
|
private |
CurrencyDisplay::$_vendorCurrency = 0 |
CurrencyDisplay::$_vendorCurrency_code_3 = 0 |
CurrencyDisplay::$_vendorCurrency_numeric = 0 |
CurrencyDisplay::$exchangeRateShopper = 1.0 |
|
static |