Magento: Easy reading attributes of simple products from Configurable products - Ybus
6293
post-template-default,single,single-post,postid-6293,single-format-standard,ajax_fade,page_not_loaded,,side_area_uncovered_from_content,qode-child-theme-ver-1.0.0,qode-theme-ver-10.0,wpb-js-composer js-comp-ver-4.12,vc_responsive

Magento: Easy reading attributes of simple products from Configurable products

Magento: Easy reading attributes of simple products from Configurable products

download


/**
* Load Product you want to get Super attributes of
*/
$product=Mage::getModel("catalog/product")->load(52520);
/**
* Get Configurable Type Product Instace and get Configurable attributes collection
*/
$configurableAttributeCollection=$product->getTypeInstance()->getConfigurableAttributes();
/**
* Use the collection to get the desired values of attribute
*/
foreach($configurableAttributeCollection as $attribute){
echo "Attr-Code:".$attribute->getProductAttribute()->getAttributeCode()."
";
echo "Attr-Label:".$attribute->getProductAttribute()->getFrontend()->getLabel()."
";
echo "Attr-Id:".$attribute->getProductAttribute()->getId()."
";
var_dump($_attribute->debug()); // returns the set of values you can use the get magic method on
}

From http://www.webtechunit.com/magento/getting-configurable-attributes-super-attributes-of-a-configurable-product/



Get a free SEO Analysis

from Ybus


Keywords
SEO on Page
Ranking Status
Competion Analysis