protected function validateDimensionProduct()
    {
        $fields = array(
            'width' => $this->translation->text('Width'),
            'height' => $this->translation->text('Height'),
            'length' => $this->translation->text('Length'),
            'weight' => $this->translation->text('Weight')
        );

        $errors = 0;
        foreach ($fields as $field => $label) {

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

            if (!isset($value)) {
                continue;
            }

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

            if (strlen($value) > 10) {
                $errors++;
                $this->setErrorLengthRange($field, $label, 0, 10);
            }
        }

        return empty($errors);
    }
protected function validateDimensionProduct()
    {
        $fields = array(
            'width' => $this->translation->text('Width'),
            'height' => $this->translation->text('Height'),
            'length' => $this->translation->text('Length'),
            'weight' => $this->translation->text('Weight')
        );

        $errors = 0;
        foreach ($fields as $field => $label) {

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

            if (!isset($value)) {
                continue;
            }

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

            if (strlen($value) > 10) {
                $errors++;
                $this->setErrorLengthRange($field, $label, 0, 10);
            }
        }

        return empty($errors);
    }
protected function validateDimensionProduct ( ) { $ fields = array ( 'width' => $ this -> translation -> text ( 'Width' ) , 'height' => $ this -> translation -> text ( 'Height' ) , 'length' => $ this -> translation -> text ( 'Length' ) , 'weight' => $ this -> translation -> text ( 'Weight' ) ) ; $ errors = 0 ; foreach ( $ fields as $ field => $ label ) { $ value = $ this -> getSubmitted ( $ field ) ; if ( ! isset ( $ value ) ) { continue ; } if ( ! is_numeric ( $ value ) ) { $ errors ++ ; $ this -> setErrorNumeric ( $ field , $ label ) ; } if ( strlen ( $ value ) > 10 ) { $ errors ++ ; $ this -> setErrorLengthRange ( $ field , $ label , 0 , 10 ) ; } } return empty ( $ errors ) ; }
Validates product dimensions
@return boolean
Validates product dimensions