How you can show a certain number of products for guests in Magento?

You can customization in phtml file for display number of products for a guest. Do the following steps for customize phtml file.

In the toolbar block you will see

app/code/core/Mage/Catalog/Block/Product/List/Toolbar.php

There is a method:

Public function setCollection($collection);

Inside there is a piece of code:

$limit= (int)$this->get Limit();

If ($limit) {

$this ->_collection->setPageSize($limit);

}

You have to change variable $limit; you should override that block in the local pool, not change

directly in the core. In order to see whether the customer is a guest, you can use this code

Mage:: getSingleton(‘customer/session’) -> isLoggedIn()

 

Leave a Reply

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