protected function validateUnitProduct()
    {
        $allowed = array(
            'size_unit' => $this->convertor->getUnitNames('size'),
            'weight_unit' => $this->convertor->getUnitNames('weight')
        );

        $fields = array(
            'size_unit' => $this->translation->text('Size unit'),
            'weight_unit' => $this->translation->text('Weight unit')
        );

        $errors = 0;

        foreach ($fields as $field => $label) {

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

            if (isset($value) && !isset($allowed[$field][$value])) {
                $errors++;
                $this->setErrorUnavailable($field, $label);
            }
        }

        return empty($errors);
    }
protected function validateUnitProduct()
    {
        $allowed = array(
            'size_unit' => $this->convertor->getUnitNames('size'),
            'weight_unit' => $this->convertor->getUnitNames('weight')
        );

        $fields = array(
            'size_unit' => $this->translation->text('Size unit'),
            'weight_unit' => $this->translation->text('Weight unit')
        );

        $errors = 0;

        foreach ($fields as $field => $label) {

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

            if (isset($value) && !isset($allowed[$field][$value])) {
                $errors++;
                $this->setErrorUnavailable($field, $label);
            }
        }

        return empty($errors);
    }
protected function validateUnitProduct ( ) { $ allowed = array ( 'size_unit' => $ this -> convertor -> getUnitNames ( 'size' ) , 'weight_unit' => $ this -> convertor -> getUnitNames ( 'weight' ) ) ; $ fields = array ( 'size_unit' => $ this -> translation -> text ( 'Size unit' ) , 'weight_unit' => $ this -> translation -> text ( 'Weight unit' ) ) ; $ errors = 0 ; foreach ( $ fields as $ field => $ label ) { $ value = $ this -> getSubmitted ( $ field ) ; if ( isset ( $ value ) && ! isset ( $ allowed [ $ field ] [ $ value ] ) ) { $ errors ++ ; $ this -> setErrorUnavailable ( $ field , $ label ) ; } } return empty ( $ errors ) ; }
Validates measurement units
@return boolean
Validates measurement units