No. It's just a product presentation, no shop.
Now here's my first approach:
class ProductAttribute extends DataObject {
static $db = array(
'Attribute' => 'Text',
'Value' => 'Text',
);
static $has_one = array(
'ProductPage' => 'ProductPage',
);
static $field_names = array(
'Attribute' => 'Attribute',
'Value' => 'Value',
);
function getCMSFields_forPopup() {
$fields = new FieldSet();
$attributes = DataObject::get('ProductHolderAttribute');
if ($attributes) {
$attributes = $attributes->toDropdownMap('Title', 'Title', '(Select one)', true);
}
$fields->push(new DropdownField('Attribute', 'Attribute', $attributes));
$fields->push(new TextField('Value', 'Value'));
return $fields;
}
}
In the page:
function getCMSFields() {
$fields = parent::getCMSFields();
$attributetable = new ComplexTableField(
$this,
'ProductAttributes', // relation name
'ProductAttribute', // object class
ProductAttribute::$field_names, // fields to show in table
ProductAttribute::getCMSFields_forPopup(), // form that pops up for edit
"ProductPageID = {$this->ID}", // a filter to only display item associated with this page
);
$fields->addFieldToTab('Root.Content.Specifications', $attributetable);
return $fields;
}