You wonder how many products you have in your store and want to count them trough PHP code? It's easy, add following code to test.php (create in root folder):
PHP:
-
require_once 'app/Mage.php'; Mage::run();
-
echo Mage::getResourceModel('catalog/product_collection')->addCategoryFilter(Mage::getModel('catalog/category')->load(113))->count(); // count products in defind category 113
Podobni članki:
- Magento – how to call template or block inside category or other view
- Magento slow product save and update
- Magento – uvoz večnivojskih kategorij
- Magento – add custom category attribute, show top categories
- Magento – working with queries
- Magento massive products import with database query
- Magento override model
- Magento – razvoj novih modulov – debugiranje
- Magento – ali lahko uporabim šumnike v imenu, opisu ter URL-ju produkta?
- Magento – how to remove product gallery images