protected function validateQuantityCart()
    {
        $field = 'quantity';

        if ($this->isExcluded($field)) {
            return null;
        }

        $value = $this->getSubmitted($field);

        if (!isset($value)) {

            if ($this->isUpdating()) {
                return null;
            }

            $value = 1;
        }

        $label = $this->translation->text('Quantity');

        if (!is_numeric($value)) {
            $this->setErrorNumeric($field, $label);
            return false;
        }

        if (strlen($value) > 2) {
            $this->setErrorLengthRange($field, $label, 1, 2);
            return false;
        }

        return true;
    }
protected function validateQuantityCart()
    {
        $field = 'quantity';

        if ($this->isExcluded($field)) {
            return null;
        }

        $value = $this->getSubmitted($field);

        if (!isset($value)) {

            if ($this->isUpdating()) {
                return null;
            }

            $value = 1;
        }

        $label = $this->translation->text('Quantity');

        if (!is_numeric($value)) {
            $this->setErrorNumeric($field, $label);
            return false;
        }

        if (strlen($value) > 2) {
            $this->setErrorLengthRange($field, $label, 1, 2);
            return false;
        }

        return true;
    }
protected function validateQuantityCart ( ) { $ field = 'quantity' ; if ( $ this -> isExcluded ( $ field ) ) { return null ; } $ value = $ this -> getSubmitted ( $ field ) ; if ( ! isset ( $ value ) ) { if ( $ this -> isUpdating ( ) ) { return null ; } $ value = 1 ; } $ label = $ this -> translation -> text ( 'Quantity' ) ; if ( ! is_numeric ( $ value ) ) { $ this -> setErrorNumeric ( $ field , $ label ) ; return false ; } if ( strlen ( $ value ) > 2 ) { $ this -> setErrorLengthRange ( $ field , $ label , 1 , 2 ) ; return false ; } return true ; }
Validates cart item quantity
@return boolean|null
Validates cart item quantity