Quantcast
Channel: Backend – Marcel Schmidt Wiki / Neuigkeiten
Viewing all articles
Browse latest Browse all 10

Magento Grid show only one page (use group or groupByAttribute)

$
0
0

Verwendet man bei einem Grid group, so wird oft nur eine Seite bzw. ein Eintrag angezeigt. Um alle Einträge angezeigt zu bekommen sowie die Seiten, muss folgende Datei angepasst werden:

lib/Varien/Data/Collection/Db.php

Funktion wie folgt abändern:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
    public function getSize()
    {
        if (is_null($this->_totalRecords)) {
            $sql = $this->getSelectCountSql();
 
            $result = $this->getConnection()->fetchAll($sql, $this->_bindParams);;
 
            foreach ($result as $row) {
                $this->_totalRecords += reset($row);
            }
 
        }
        return intval($this->_totalRecords);
    }

Viewing all articles
Browse latest Browse all 10