diff --git a/lib/Varien/Data/Collection/Db.php b/lib/Varien/Data/Collection/Db.php index 5c891927438f6..ff3f6e9d78da8 100644 --- a/lib/Varien/Data/Collection/Db.php +++ b/lib/Varien/Data/Collection/Db.php @@ -690,11 +690,11 @@ public function loadData($printQuery = false, $logQuery = false) */ public function printLogQuery($printQuery = false, $logQuery = false, $sql = null) { - if ($printQuery) { + if ($printQuery || $this->getFlag('print_query')) { echo is_null($sql) ? $this->getSelect()->__toString() : $sql; } - if ($logQuery) { + if ($logQuery || $this->getFlag('log_query')) { Mage::log(is_null($sql) ? $this->getSelect()->__toString() : $sql); } return $this;