![]() |
|
|||||||
|
|
Thread Tools | Display Modes |
|
#1
IP: 153.99.38.51
|
|||
|
|||
|
Get all the products with status equal to enabled/disabled.
If you are using Flat Catalog in Magento, you will not get disabled products by this filter as in flat table all the products are only enabled one. You can check if your Magento website uses flat catalog or not by going here: Admin > System > Configuration > Catalog section > Catalog > Frontend Check Use Flat Catalog Category and Use Flat Catalog Product, if they are Yes it means you are using flat catalog, if they are No it means you are NOT using flat catalog. So, if you don’t have flat catalog enabled and you want to filter all the products with status equal to disabled, you can use below code: $products = Mage::getModel('catalog/category')->load($category_id) ->getProductCollection() ->addAttributeToSelect('*') //whatever attributes you want to get here ->addAttributeToFilter( 'status', array('eq' => Mage_Catalog_Model_Product_Status::STATUS_DISABLED) //replace DISABLED to ENABLED for products with status enabled ); |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Magento Special price products page | Rankin | Magento | 0 | 2015-04-24 04:39 AM |
| Magento Get most popular products in a category | Rangeley | Magento | 0 | 2015-04-24 04:38 AM |
| Magento: How to delete/remove all products from all categories | Random Lake | Magento | 0 | 2015-04-24 04:37 AM |
| Magento get products without category | Ranchos de Taos | 代码交流 | 0 | 2015-04-24 04:03 AM |
| How Can Your Products Show On Google Shopping Results | topvip | 闲话灌水 | 0 | 2010-10-30 10:37 AM |