protected function getFormFields()
{
$fields = FieldList::create();
if ($this->maxquantity) {
$values = array();
$count = 1;
while ($count <= $this->maxquantity) {
$values[$count] = $count;
$count++;
}
$fields->push(DropdownField::create('Quantity', _t('Shop.Quantity', 'Quantity'), $values, 1));
} else {
$fields->push(NumericField::create('Quantity', _t('Shop.Quantity', 'Quantity'), 1)->setAttribute('type', 'number')->setAttribute('min', '0'));
}
return $fields;
}