0

I use grid view in my store, and have already removed the option to switch to list view. However, Google has indexed a large amount of list view pages and keep on sending users to this view.

Is it possible to automatically switch to grid view if list view is detected?

Magento version: 1.9.2.4

Thanks

0

In Backend

Go to System-> configuration-> Catalog-> Frontend-> ListMode-> Select List Only

  • I have this setting in admin, but this only prevents users from being able to change. However when Google already has indexed a page with ?mode=list the list mode will still show. When this happens I would like Magento to overrule the ?mode=list setting so that it displays grid view instead. – Espen Nov 20 '16 at 20:03
0

You can set below product list mode from admin.

"Grid Only"

"List Only"

"Grid (default) / List"

"List (default) / Grid"

System >> Configuration >> Catalog >> Catalog >> Frontend >> List Mode.
  • I have this setting in admin, but this only prevents users from being able to change. However when Google already has indexed a page with ?mode=list the list mode will still show. When this happens I would like Magento to overrule the ?mode=list setting so that it displays grid view instead. – Espen Nov 20 '16 at 20:04
0

I figured out one solution:

I copied /template/catalog/product/list.phtml into my theme, and changed line 45 from <?php if($this->getMode()!='grid': ?> to <?php if($this->getMode()=='grid' || $this->getMode()=='list'): ?> and removed line 46 to 152 where the code for list mode was. In this way both modes will display as grid.

-Espen

  • First copy list.phtml from base/default to your_theme/default then edit list.phtml file of your theme folder only – Gopal Patel Nov 21 '16 at 3:42

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.