-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Description
We've been implementing your controller methods - thank you.
I've been trying to add select attribute values programmatically:
public function installSelect($pkg) {
// add a new set to page attr
$selectSet = $this->addAttributeSet('collection', 'my_selects', 'Selects', $pkg);
// set a new page attr key object
$collectionKey = new CollectionKey;
// create a select page attribute and add to the set
$selectAttr = $this->addAttribute('my_new_select', 'My New Select', 'select', $collectionKey, $selectSet, $pkg, true);
$optionValues = array('value1', 'value2', 'value3', 'value4');
$options = array();
$displayOrder = 0;
$list = new SelectValueOptionList();
foreach($optionValues as $value) {
$opt = new SelectValueOption();
$opt->setSelectAttributeOptionValue($value);
$opt->setDisplayOrder($displayOrder);
//$opt->setOptionList($list);
$options[] = $opt;
$displayOrder++;
}
$type = $selectAttr->getController()->getAttributeKey()->getAttributeKeySettings();
$list->setOptions($options);
$type->setOptionList($list);
}
But can't seem to apply the Option List in atSelectOptions.avSelectOptionListID
I wonder if you have had any luck in this area?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels