I am trying to display a custom multiselect attribute as images on the frontend if they have been selected by the store admin.
So far I have been able to get the values "as text" on the frontend but I am not sure how I can go about associating each value with an image...
Here is what I have so far
<?php
$multiSelectArray = $this->getProduct ()->getAttributeText('suitable_for');
$lastItem = end ($multiSelectArray);
foreach ($multiSelectArray as $multiSelectItem) {
echo $multiSelectItem;
if ($multiSelectItem != $lastItem) echo ", ";
}
?>
The above code will show the values of the multiselect but I am stuck on how to associate the values with an image instead of text.
I anyone can assist I'd be very grateful!