I found this sollution for filtering multiple multi-select attribute values.
$data = THE ARRAY OF THE CHECKBOX VALUES;
$filter = array();
foreach ($data as $value) {
$filter[] = array(
'attribute' => $attribute->getAttributeCode(),
'finset' => $value
);
}
if (count($filter) > 0) {
$collection->addAttributeToFilter($filter);
}
I need to filter the output alphabetically. For example my attribute looks like this:
Label Value
apple 1051
banana 1052
pear 1053
melon 1054
and I want to sort it not on values but on labels.