diff --git a/app/code/community/Meanbee/BestSellerSort/Model/Attributes.php b/app/code/community/Meanbee/BestSellerSort/Model/Attributes.php index b4f112e..823a9e6 100644 --- a/app/code/community/Meanbee/BestSellerSort/Model/Attributes.php +++ b/app/code/community/Meanbee/BestSellerSort/Model/Attributes.php @@ -19,11 +19,10 @@ public function updateQtyOrdered() * - Avoids nulls being shown before all products when ordered ascendingly */ $productCollection = Mage::getResourceModel('catalog/product_collection') - ->addAttributeToFilter(Meanbee_BestSellerSort_Helper_Data::ATTRIBUTE_NAME_QTY_ORDERED, - array('neq' => 0) - ); + ->addAttributeToSelect(array(Meanbee_BestSellerSort_Helper_Data::ATTRIBUTE_NAME_QTY_ORDERED)); - foreach($productCollection as $product) { + foreach ($productCollection as $product) + { $product->setData(Meanbee_BestSellerSort_Helper_Data::ATTRIBUTE_NAME_QTY_ORDERED, 0); $resource->saveAttribute($product, Meanbee_BestSellerSort_Helper_Data::ATTRIBUTE_NAME_QTY_ORDERED); }