Magento Forum

   
Losing category page ID when changing list - grid view mode
 
onepack
Sr. Member
 
Total Posts:  98
Joined:  2008-06-02
Amsterdam
 

I’m testing the front of the website and saw something I never noticed before.
When I’m in a main category browsing through the 20 pages with products and decide to change the view, on page 3 or any other page, from list to grid/grid - list I’m kicked back to page id 1.

First I thought it was because of the difference in product numbers set for grid and list view but that was not the case as I gave them the same product numbers per page.

Is this a bug? Is there a way to keep the URL parameter &p;=x?

It must be very frustrating for customers that are on page 15 and change from list to grid to find themselves back on page 1.

 
Magento Community Magento Community
Magento Community
Magento Community
 
onepack
Sr. Member
 
Total Posts:  98
Joined:  2008-06-02
Amsterdam
 

Ok, fixed this myself and this should be DEFAULT Magento behaviour with a setting in the backend when underlying condition is true..
Condition: this will only work when you have the same product-per-page numbers for list and grid view

In (famous) toolbar.phtml

Add:

<?php $currentpage $this->getCollection()->getCurPage();?>
right after:
<?php if($this->getCollection()->getSize()): ?>

Then change:

<?php echo $this->getModeUrl($_code?>
To:
<?php echo $this->getModeUrl($_code) . "&amp;p=" $currentpage?>

Et Voila, a customer is not kicked back to category page 1 when they change grid-list view mode on page 12.

When somebody has a better way to make this also work with different product-per-page numbers, please reply to this topic.

 
Magento Community Magento Community
Magento Community
Magento Community
 
MageBright
Sr. Member
 
Avatar
Total Posts:  86
Joined:  2011-11-21
 

May be this link someone help

http://www.magentocommerce.com/magento-connect/category-custom-view-7071.html

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top