Creating a custom Magento module posted by ekononov Magento community provides us with a great variety of modules (free and paid), available for downloading and installing from Magento Connect catalog, and from 3rd party developers' websites. Together with the rich...
Month: January 2015
create filter by attribute (my code)
$attribute = Mage::getModel('eav/config')->getAttribute('catalog_product', 'forme_shape'); foreach ($attribute->getSource()->getAllOptions(true, true) as $instance) { // $myArray] = $instance; //$productCollection_shape= $category_shape=Mage::getModel('catalog/category')->load($idcats); $productCollection_qty = $category_shape->getProductCollection() ->addAttributeToSelect(array('name', 'forme_shape')) ->addAttributeToFilter('forme_shape', array('eq' =>$instance )) ->count(); //print_r($productCollection_qty); if($productCollection_qty>0) { $myArray] = $instance; } } //print_r($myArray);
magento: get all attribute options
Mage::getSingleton("eav/config")->getAttribute("catalog_product", $attribute_code); $options = $attribute_details->getSource()->getAllOptions(false);