I think what you are really looking for is a way of printing in your template the attribute value labels corresponding to those comma-separated IDs. I see no point storing the labels themselves in the database flat tables, as this will require significant overhead whenever an attribute value label is changed in Admin: you would need to have code that iterates over all occurrences of that value ID (say 239) and update all related flat tables accordingly. Also, if you amended only the flat tables, this would cause issues when flat tables are disabled for any reasons.
You can include the labels in your template either by using:
echo $_product->getResource()->getAttribute('custom_mult_attr')->getFrontend()->getValue($_product);
or by splitting the comma-separated list of IDs and fetching the correct store value label for each, for example by using something like:
if (($attr = $_product->getResource()->getAttribute('custom_mult_attr')) && $attr->usesSource()) {
if ($ids = explode(',', $_product->getData('custom_mult_attr'))) {
foreach ($ids as $id) {
echo $attr->getSource()->getOptionText($id);
}
}
}
This - of course - is just an example, the actual code may have to be amended to suit your needs, but it should give you an idea.
Should you still want to store the labels in the flat tables, I'd suggest you create another attribute of type text, and populate/update it on product or attribute save with the label values obtained as per the examples above.
After a lot of digging I found a solution why my attribute values wasn't able to be assigned to product. In "if" add:
$data['backend'] = 'Magento\Eav\Model\Entity\Attribute\Backend\ArrayBackend';
Whole if:
if (!$multiSelectData === false && is_array($multiSelectData)) {
$data['input'] = 'multiselect';
$data['option'] = array('values' => $multiSelectData);
$data['backend'] = 'Magento\Eav\Model\Entity\Attribute\Backend\ArrayBackend';
}
Best Answer
These were a constants, which is held in the class Mage_Catalog_Model_Product_Visibility you need to override that class and add your custom visibility option.
Here you can add your custom option and get it value.