Get options for select attribute

Submitted by remo - 3 years ago

If you have a select attribute and wish to get the options for it, use the code below

$cak = CollectionAttributeKey::getByHandle('your_attribute_handle');
$at = AttributeType::getByHandle('select');
$satc = new SelectAttributeTypeController($at);
$satc->setAttributeKey($cak);
$values = $satc->getOptions();
Stats Categories Tags
comments powered by Disqus