Hi,
I have some problem with multi-select list, I just want to get ONLY selected values from admin panel ( product attributes multi-select list ), the example output is on this URL -> http://frakta.he-hosting.de/silence-4-nm-60.html
This is Product attribute multi-select code from Magento admin panel:
HTML Code:
<select>
<option selected="selected" value="17">230V</option>
<option selected="selected" value="18">24VAC</option>
<option value="20">24VAC/DC</option>
<option value="19">24VDC</option>
</select>
Here is also my code from view.phtml file (product view):
Code:
function getSelectAttributeValues($attrCode) {
$attributeCode = $attrCode;
// build and filter the product collection
$products = Mage::getResourceModel('catalog/product_collection')
->addAttributeToFilter($attributeCode, array('notnull' => true))
->addAttributeToFilter($attributeCode, array('neq' => ''))
->addAttributeToSelect($attributeCode);
// ### it returns all values from multi-select list, but it should return only selected
$usedAttributeValues = array_unique($products->getColumnValues($attributeCode));
// fetch the attribute model
$attributeModel = Mage::getSingleton('eav/config')->getAttribute('catalog_product', $attributeCode);
// map the option id's to option labels
$usedAttributeValues = $attributeModel->getSource()->getOptionText(
implode(',', $usedAttributeValues)
);
if (is_array($usedAttributeValues)) {
return implode(', ', $usedAttributeValues);
} else {
return $usedAttributeValues;
}
}
Please help me, I'll be gratefull for any advice Smiley Happy
View more threads in the same category:
- Transforming Karachi's Skylines with Fiber Shades
- Unveiling the Power of E911 Solutions Enhancing Caller Identification
- List of Top 10 Interior Designers in Pakistan
- buy registered drivers license online(legitcleandocs.com)passport,IELTS certific
- Malaysia Visit Visa from Dubai
- Buy Passport,Driver License,Age & ID Card,(Whatsapp:.......: +1 (551) 239-2904) Visas
- 슬롯사이트 추천 - 인터넷슬롯링크 2024 best 온라인슬롯
- Buy Passport,Driver License,Age & ID Card,(Whatsapp:.......: +1 (551) 239-2904) Visas
- Buy Passport,Driver License,Age & ID Card,Visas and Undetected Counterfeit Money. Ema
- Buy Passport,Driver License,Age & ID Card,(Whatsapp:.......: +1 (551) 239-2904) Visas
Bookmarks