3

Mage 1.7.0.2 CE

I am having a problem updating the grid.php to increase the default limit which is currently at 200. I have edited the grid.phtml file to display 500 in the dropdown on the Sales Order Grid but I can't get it to work, it just loads the dashboard of Mage when I click on it.

So I'm pretty sure I need to edit the grid.php here:

/app/code/local/Mage/Adminhtml/Catalog/Product/Grid.php 

To allow for an increase in the default limit. However when I add this:

public function __construct()
{
    parent::__construct();
    $this->setDefaultLimit(100);

It breaks Mage with a 500 error.

So I'd like to know what I need to do to override the default limit of 200, so I can increase it to 500. It's important since my employer uses the sales order grid to process orders.

Thanks~

  • I copy/pasted the wrong path. I edited the sales order grid.php, not products. – user4080 Nov 25 '13 at 18:50
  • Hope this would help. mydons.com/… – Sukeshini Nov 26 '13 at 4:41
9

Edit the grid.phtml file located:

.../app/design/adminhtml/default/default/template/widget/grid.phtml

At line 81-87:

<select name="<?php echo $this->getVarNameLimit() ?>” onchange="<?php echo $this->getId() ?>JsObject.loadByElement(this)"> 
  <option value="20"<?php if($this->getCollection()->getPageSize()==20): ?> selected="selected"<?php endif; ?>>20</option> 
  <option value="30"<?php if($this->getCollection()->getPageSize()==30): ?> selected="selected"<?php endif; ?>>30</option> 
  <option value="50"<?php if($this->getCollection()->getPageSize()==50): ?> selected="selected"<?php endif; ?>>50</option> 
  <option value="100"<?php if($this->getCollection()->getPageSize()==100): ?> selected="selected"<?php endif; ?>>100</option> 
  <option value="200"<?php if($this->getCollection()->getPageSize()==200): ?> selected="selected"<?php endif; ?>>200</option> 
</select>

Changing the above to the below for example:

<select name="<?php echo $this->getVarNameLimit() ?>” onchange="<?php echo $this->getId() ?>JsObject.loadByElement(this)"> 
  <option value="200"<?php if($this->getCollection()->getPageSize()==200): ?> selected="selected"<?php endif; ?>>200</option> 
  <option value="300"<?php if($this->getCollection()->getPageSize()==300): ?> selected="selected"<?php endif; ?>>300</option> 
  <option value="500"<?php if($this->getCollection()->getPageSize()==500): ?> selected="selected"<?php endif; ?>>500</option> 
  <option value="1000"<?php if($this->getCollection()->getPageSize()==1000): ?> selected="selected"<?php endif; ?>>1000</option> 
  <option value="2000"<?php if($this->getCollection()->getPageSize()==2000): ?> selected="selected"<?php endif; ?>>2000</option> 
</select>

Hope this helps?

  • This link should also help and is along the same lines: magentothemess.com/archives/1090 – MagentoMac Nov 26 '13 at 0:05
  • dope! this worked perfectly for me TY! – CodingMageSheen Nov 23 '16 at 4:27
  • After added this, <option value="500"<?php if($this->getCollection()->getPageSize()==500): ?> selected="selected"<?php endif; ?>>500</option> not wokring, not show 500 – Gem Mar 24 '18 at 10:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.