Post by alindevil » Fri Nov 15, 2013 9:38 pm

I have created a category for Promotions and I want it to have a certain number of items/page which is different from the default items/page from the config and I also want it to default to GRID View without affecting the cookie that stores the default LIST View.

The Grid View thingy I figured it out already but I'm stuck with the first one.

What I'm trying to achieve is the same result as a link like this http://www.mysite.com/promotions?limit=24, but I want this behaviour by default for that category alone without the extra parameter in the link.

In /www/catalog/view/theme/{theme_name}/template/product/category.tpl i found this :

Code: Select all

<?php if ($limits['value'] == $limit) { ?>
so I presume that $limits['value'] is where I should change the value but I just can't figure it out where should I place some code like :

Code: Select all

$limits['value'] = 24;
or

Code: Select all

$limit = 24;
Is this the right way to achieve what I'm looking for ?

Newbie

Posts

Joined
Wed May 29, 2013 3:03 pm

Post by inactiveaccount9912 » Sat Nov 16, 2013 7:51 am

Edit catalog/controller/product/category.php and find the line:

Code: Select all

$category_info = $this->model_catalog_category->getCategory($category_id);
below it add:

Code: Select all

if($category_id == 9999) {
	    if (isset($this->request->get['limit'])) {
			$limit = $this->request->get['limit'];
		} else {
			$limit = 24;
		}
		}
in the above code 9999 is to be replaced by the id of the category you want.

This way youd have the default 24 or whatever number you input, yet if the customer selects other limit it would still work.

Expert Member

Posts

Joined
Fri May 14, 2010 2:36 am
Who is online

Users browsing this forum: Bing [Bot] and 111 guests