Add “View all” option in magento 1.8.0 backend in category product for easier position edit

Have you had the problem wanting to sort the product in position in Magento but having problem to see all products at once?
add-view-all-option-in-magento-backend-in-category-product-for-easier-position-edit

Here’s a quick fix:

  1. Open grid.phtml located in app\design\adminhtml\default\default\template\widget/grid.phtml (Even though this tutorial is done on magento 1.8.0, I’m sure you can find this in other version too)
  2. Look for the following code in line 80:
    <select name="<?php echo $this->getVarNameLimit() ?>" onchange="<?php echo $this->getJsObjectName() ?>.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>
  3. Add a new line to the option:
    <option value="<?php echo $this->getCollection()->getSize(); ?>"<?php if($this->getCollection()->getPageSize()==$this->getCollection()->getSize()): ?> selected="selected"<?php endif; ?>>All</option>

    What it does it’s just basically simple. Instead of putting a fixed number as the limit for products to be displayed in each page, it uses the total number of products in this category as the limit.

  4. Please note that if your total number of products are really huge, don’t use view all, try 500 or 1000 instead.

 

 

Does this post help? Share this tutorial as a support to us!

Leave a Reply

Your email address will not be published. Required fields are marked *