Total Posts: 82
I don’t know how you would call each item individually, but I don’t think that you need to do that to accomplish your goal. I had a similar issue using a “features” multi-select attribute on my products. Selecting features from the multi-select in the admin would turn on/off icons to display on the product view page.
Here’s what I did in app/design/frontend/default/dxg(my theme)/template/catalog/product/view.phtml:
$icons = array(
$feature_ids = explode(',', $this->getProduct()->getFeatures());
$_product = $this->getProduct();
$feature_names = explode(',', $_product->getResource()->getAttribute('features')->getFrontend()->getValue($_product));
$features = array_combine($feature_ids, $feature_names);
<?php foreach($feature_ids as $id): ?>
<div class="icon-item"><img src="<?php echo $this->getSkinUrl('images/dxg/'.$icons[$id]) ?>" alt="<?php echo htmlentities(trim($features[$id]))?>" title="<?php echo htmlentities(trim($features[$id]))?>"></div>
<?php endforeach; ?>
}// endif count
The first call to $this->getProduct()->getFeatures() returns a comma separated list of numbers that are the value ids in the db of the selected items in my admin multi select. The call to $_product->getResource()->getAttribute("features")->getFrontend()->getValue($_product) returns a comma separated list of the corresponding names of those value ids. Using explode and then array combine will give you an array of ids and values that you can loop through and apply your display logic.
The alt and title tags give my icons the tooltips when you mouse over. Hope that helps you out.