Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $productCollection = Mage::getModel('catalog/product')->getCollection()
- ->addAttributeToFilter('type_id', ['eq' => Mage_Catalog_Model_Product_Type::TYPE_CONFIGURABLE])
- ->addAttributeToFilter('status', ['eq' => Mage_Catalog_Model_Product_Status::STATUS_ENABLED])
- ->addAttributeToSelect('some_custom_attribute')
- ->addAttributeToSelect('name');
- SELECT `e`.*, `at_status`.`value` AS `status` FROM `catalog_product_entity` AS `e`
- INNER JOIN `catalog_product_entity_int` AS `at_status` ON (`at_status`.`entity_id` = `e`.`entity_id`) AND (`at_status`.`attribute_id` = '96') AND (`at_status`.`store_id` = 0) WHERE (`e`.`type_id` = 'configurable') AND (at_status.value = 1))
- foreach ($productCollection as $product) {
- echo "Product is: ".$product->getId()." with name ".$product->getName()." with value of custom attribute ".$product->getSomeCustomAttribute()."n";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement