SilverCart Forum

We moderate this Forum and we're here to help. Have you already run a forum search to check if your problem has already been solved?

You can help us helping you by providing detailed error messages, screenshots and logfile entries.

SebastianRamon

Page: 1
Topic Change default view of ProductGroups 2162 Views

Change default view of ProductGroups

23 August 2011 at 11:20am

Hi there,

I want to remove the button to switch between tile and list view.

But now I need to define the default view. Can someone help me out here and give me a hint on how to do that without digging up too much code?

thx, jethro

Re: Change default view of ProductGroups

23 August 2011 at 11:25am

Ok, I found a very pragmatic way: I just copy the content of the desired SilvercartProductGroupHolderTile.ss into the SilvercartProductGroupHolderList.ss

But I am sure you guys know a more elegant way :-)

thx, Jethro

Re: Change default view of ProductGroups

23 August 2011 at 12:34pm

Hi Jethro,

by default there are two types to display products/productgroups. List and tile view.

In your _config.php you can disable one of the views by using this methods:

SilvercartGroupViewHandler::removeGroupHolderView('SilvercartGroupViewList');
SilvercartGroupViewHandler::removeGroupView('SilvercartGroupViewTile');

This code example will remove the listed view for productgroups and the tiled view for products.

If you want to use both (list and tile) with tile as default view for products but only list for productgroups, use the following code:

SilvercartGroupViewHandler::removeGroupHolderView('SilvercartGroupViewTile');
SilvercartGroupViewHandler::setDefaultGroupView('SilvercartGroupViewTile');

Regards,
Sebastian

Re: Change default view of ProductGroups

23 August 2011 at 2:55pm

thx Sebastian, this is so easy it makes me feel stupid %-) Maybe this should go into a faq or something, it is a great recipe.

Bye, Jethro