Skip to content

Instantly share code, notes, and snippets.

@Dan0sz
Last active October 21, 2018 12:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Dan0sz/e8cdfc84a53c0f9eb7ee08e97ee22c7f to your computer and use it in GitHub Desktop.
Save Dan0sz/e8cdfc84a53c0f9eb7ee08e97ee22c7f to your computer and use it in GitHub Desktop.
How to show only Visible/Active Products in Product Count
<?php
$collection = $_category->getProductCollection();
$collection->setVisibility(array(Mage_Catalog_Model_Product_Visibility::VISIBILITY_BOTH, Mage_Catalog_Model_Product_Visibility::VISIBILITY_IN_CATALOG));
$collection->addFieldToFilter('status',Mage_Catalog_Model_Product_Status::STATUS_ENABLED);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment