B-219 Sec-55 Noida, India

Fetch configurable product attributes values

Getting all options of a specific magento configurable product attribute is fairly easy:

getAttribute('catalog_product', 'color');
foreach ($attribute->getSource()->getAllOptions(true) as $option) {
echo $option['value'] . ' ' . $option['label'] . "n";

get options and their values which are applicable to a particular configurable product

$attributeOptions = array();
foreach ($productAttributeOptions as $productAttribute) {
foreach ($productAttribute['values'] as $attribute) {
$attributeOptions[$productAttribute['label']][$attribute['value_index']] = $attribute['store_label'];

(Visited 55 times, 1 visits today)

Leave a reply

You must be logged in to post a comment.