Display Product/Category in List or Grid

  • Posts: 57
  • Thank you received: 4
9 years 3 months ago #189444

Hello.
I really need your help.
Can you please help me ?

I need to put in the top 2 buttons. One is to display the products in grid view and the other to display the products in list view. When we click in the button the view change (or to list if we press list button, or to grip if we press grid button).

The same will have to do for the categories .

Can you please help me explaining to me where I can do this and how?

Thanks.

Please Log in or Create an account to join the conversation.

  • Posts: 81677
  • Thank you received: 13102
  • MODERATOR
9 years 3 months ago #189449

Hi,

It will require you to create two menu items configured similarily but with a different type of layout (DIV and table).
Then, edit the file "listing" of the view "product" for your frontend template and you can add some custom code at the beginning like that:

<?php global $Itemid;
if($Itemid==XXX){ ?>
<a href="YYY">grid</a>
<?php else{ ?>
<a href="ZZZ">list</a>
<?php } ?>
where XXX is the id of your list menu item and ZZZ the link to that menu item and YYY the link to the grid menu item.

The following user(s) said Thank You: rfernandes

Please Log in or Create an account to join the conversation.

  • Posts: 57
  • Thank you received: 4
9 years 3 months ago #189513

Hi nicolas,

Thanks for your help but unfortunately I don't understood.

I need to create multiple lists in hikashop?
Can you please show me a sample code or printscreens to realize better? I think that may be a common question for many people.

Thank you and sorry for the inconvenience .

Please Log in or Create an account to join the conversation.

  • Posts: 81677
  • Thank you received: 13102
  • MODERATOR
9 years 3 months ago #189522

Hi,

Yes, you need to create two products listing menu items. One for each type of display.
I already gave you a sample code. Just use it and replace the values in it as I explained and it will work.

Please Log in or Create an account to join the conversation.

Time to create page: 0.059 seconds
Powered by Kunena Forum