0

I have a collection of products which consist of configurable products that are visible and active.

How do i get all values in an array of an attribute called manu_color of each configurable product.

I is important that i only get manu_color of the simple products if the simple product are actually saleable.

Any help would be appreciated :)

1 Answer 1

1

Ok so far i have this. Problem is that array return identical values. Will post update when i have it working 100%

if($_product->getTypeId() == "configurable"):
            $conf = Mage::getModel('catalog/product_type_configurable')->setProduct($_product);
            $simple_collection = $conf
                ->getUsedProductCollection()
                ->addAttributeToSelect('*')
                ->addAttributeToFilter('status', 1)
                ->addFilterByRequiredOptions();
                Mage::getSingleton('cataloginventory/stock')->addInStockFilterToCollection($simple_collection);
            $manuColor = array();
            foreach($simple_collection as $simple_product){
                $manu_color[] = $simple_product->getAttributeText('manu_color');
            }
        endif;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.