Post by bisam » Thu Jul 23, 2009 5:50 pm

Hi, how do I turn off the message "There are no products to list in this category." and force OC 1.3 to display the category description instead?

Newbie

Posts

Joined
Tue Aug 12, 2008 10:23 pm

Post by codecreator » Fri Jul 24, 2009 2:00 pm

bisam,

I am on 1.29 but the work around should be similar. Essentially you need to modify the conditional that is used to determine whether to display the standard template when the category has assigned subcategories/products or display the "error/not_found.tpl" template.

The conditional statement can be found on or about line 91 of catalog/controller/product/category.php:

Code: Select all

if (($category_total) || (product_total)) {
As you can see the conditional is based on whether there are any subcategories or products for the selected category. You can modify it to suit your requirements. I modified it like this:

Code: Select all

if ( ($category_total) || (product_total)) || (!empty($this->data['description'])) ) {
HTH

New member

Posts

Joined
Mon Aug 04, 2008 6:39 pm

Post by codecreator » Fri Aug 21, 2009 1:48 am

I upgraded to 1.3.2 and applied this modification and discovered a typo in the code from my previous post. So, here is a copy/paste version of the corrected code for v1.3.2:

On or about line 93 of {your_store_directory}/catalog/controller/product/category.php:

Code: Select all

 if ($category_total || $product_total) { 
Modify this line to read:

Code: Select all

 if ($category_total || $product_total || (!empty($this->data['description']))) { 
Hope someone finds this helpful.

New member

Posts

Joined
Mon Aug 04, 2008 6:39 pm

Post by flightoffancy » Fri Feb 19, 2010 10:51 am

Dredging up an old post here to see if there's a way to get the description to display as well as keep the no products message?

I tried adding this to the else statement but that didn't have any results. Of course, it can't be that simple. :-\

Code: Select all

$this->data['description'] = $category_info['description'];

New member

Posts

Joined
Fri Jan 22, 2010 9:34 pm
Who is online

Users browsing this forum: No registered users and 26 guests