source/Core/InputValidator.php
public function validateBasketAmount($amount)
    {
        $amount = str_replace(',', '.', $amount);

        if (!is_numeric($amount) || $amount < 0) {
            /**
             * @var \OxidEsales\Eshop\Core\Exception\ArticleInputException $exception
             */
            $exception = oxNew(\OxidEsales\Eshop\Core\Exception\ArticleInputException::class);
            $exception->setMessage(\OxidEsales\Eshop\Core\Registry::getLang()->translateString('ERROR_MESSAGE_INPUT_INVALIDAMOUNT'));
            throw $exception;
        }

        if (!\OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('blAllowUnevenAmounts')) {
            $amount = round(( string ) $amount);
        }

        //negative amounts are not allowed
        //$dAmount = abs($dAmount);

        return $amount;
    }
public function validateBasketAmount($amount)
    {
        $amount = str_replace(',', '.', $amount);

        if (!is_numeric($amount) || $amount < 0) {
            /**
             * @var \OxidEsales\Eshop\Core\Exception\ArticleInputException $exception
             */
            $exception = oxNew(\OxidEsales\Eshop\Core\Exception\ArticleInputException::class);
            $exception->setMessage(\OxidEsales\Eshop\Core\Registry::getLang()->translateString('ERROR_MESSAGE_INPUT_INVALIDAMOUNT'));
            throw $exception;
        }

        if (!\OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('blAllowUnevenAmounts')) {
            $amount = round(( string ) $amount);
        }

        //negative amounts are not allowed
        //$dAmount = abs($dAmount);

        return $amount;
    }
public function validateBasketAmount ( $ amount ) { $ amount = str_replace ( ',' , '.' , $ amount ) ; if ( ! is_numeric ( $ amount ) || $ amount < 0 ) { /**
             * @var \OxidEsales\Eshop\Core\Exception\ArticleInputException $exception
             */ $ exception = oxNew ( \ OxidEsales \ Eshop \ Core \ Exception \ ArticleInputException :: class ) ; $ exception -> setMessage ( \ OxidEsales \ Eshop \ Core \ Registry :: getLang ( ) -> translateString ( 'ERROR_MESSAGE_INPUT_INVALIDAMOUNT' ) ) ; throw $ exception ; } if ( ! \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getConfigParam ( 'blAllowUnevenAmounts' ) ) { $ amount = round ( ( string ) $ amount ) ; } //negative amounts are not allowed //$dAmount = abs($dAmount); return $ amount ; }
Validates basket amount.

@param float $amount Amount of article.

@throws ArticleInputException If amount is not numeric or smaller 0.

@return float
Validates basket amount .