См. определение в файле calculation.php строка 17
◆ checkConfig()
static checkConfig |
( |
array |
$config | ) |
|
|
staticprotected |
Validate new settings (allowed keys and values).
См. определение в файле calculation.php строка 198
◆ compare()
static compare |
( |
|
$firstValue, |
|
|
|
$secondValue, |
|
|
|
$operator |
|
) |
| |
|
static |
Returns the result of comparing two values with the precision of rounding.
- Аргументы
-
float | int | $firstValue | First value. |
float | int | $secondValue | Second value. |
string | $operator | Compare operator ( >, >=, <, <=, ==, !=). |
- Возвращает
- bool
См. определение в файле calculation.php строка 161
◆ getConfig()
Returns current calculation settings.
- Возвращает
- array
См. определение в файле calculation.php строка 60
◆ getCurrency()
Returns result calculation currency.
- Возвращает
- string
См. определение в файле calculation.php строка 92
◆ getPrecision()
Returns calculation precision.
- Возвращает
- int
См. определение в файле calculation.php строка 102
◆ getResultMode()
◆ isAllowedUseDiscounts()
static isAllowedUseDiscounts |
( |
| ) |
|
|
static |
Returns true if allowed use discounts.
- Возвращает
- bool
См. определение в файле calculation.php строка 112
◆ isComponentResultMode()
static isComponentResultMode |
( |
| ) |
|
|
static |
◆ isIncludingVat()
static isIncludingVat |
( |
| ) |
|
|
static |
Returns true if result price with VAT.
- Возвращает
- bool
См. определение в файле calculation.php строка 122
◆ isRawResultMode()
static isRawResultMode |
( |
| ) |
|
|
static |
◆ popConfig()
Set the calculation settings from the stack, if it is not empty.
- Возвращает
- void
См. определение в файле calculation.php строка 80
◆ pushConfig()
Save current calculation settings to the stack before the changes.
- Возвращает
- void
См. определение в файле calculation.php строка 70
◆ roundPrecision()
static roundPrecision |
( |
|
$value | ) |
|
|
static |
Rounding the price or discount to a specified number of decimal places.
- Аргументы
-
float | int | $value | Value for rounding. |
- Возвращает
- float
См. определение в файле calculation.php строка 148
◆ setConfig()
static setConfig |
( |
array |
$config | ) |
|
|
static |
Set calculation settings.
- Аргументы
-
array | $config | keys are case sensitive:
-
string CURRENCY Result currency (can be null - use base currency (compatibility only)).
-
int PRECISION Calculation precision (can be null - use default catalog precision - CATALOG_VALUE_PRECISION).
-
bool USE_DISCOUNTS Use discounts for calculation (by default use discounts is allowed).
-
bool RESULT_WITH_VAT Returns result price without/with VAT (by default return price with VAT).
-
int RESULT_MODE Returns raw result for provider or prepared result for components (by default - for components).
|
- Возвращает
- void
См. определение в файле calculation.php строка 46
◆ $config
Инициализатор= array(
'CURRENCY' => null,
'PRECISION' => null,
'USE_DISCOUNTS' => true,
'RESULT_WITH_VAT' => true,
'RESULT_MODE' => self::RESULT_MODE_COMPONENT
)
См. определение в файле calculation.php строка 22
◆ RESULT_MODE_COMPONENT
const RESULT_MODE_COMPONENT = 1 |
◆ RESULT_MODE_RAW
const RESULT_MODE_RAW = 2 |