Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Category description display on first page only

Category description display on first page only

Locked

Views: 965

Results 1 to 3 of 3
This thread is locked. New replies are disabled.
22 Nov 2010, 8:35 AM
#1
securit avatar

securit

New Zenner

Join Date:
Oct 2009
Location:
Nelson, NZ
Posts:
26
Plugin Contributions:
0

Category description display on first page only

Hi

Is there a way to show the category description only on the first page of any product list?

ie on page 2,3 etc it does not display but on page 1 it does?

Thanks

22 Nov 2010, 2:10 PM
#2
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Category description display on first page only

You could customize the products_listing.php module with something like:

        $lc_text = '<h3 class="itemTitle"><a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . (($_GET['manufacturers_id'] > 0 and $_GET['filter_id'] > 0) ?  zen_get_generated_category_path_rev($_GET['filter_id']) : ($_GET['cPath'] > 0 ? zen_get_generated_category_path_rev($_GET['cPath']) : zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&products_id=' . $listing->fields['products_id']) . '">' . $listing->fields['products_name'] . '</a></h3>' . ($_GET['page'] <= 1 ? '<div class="listingDescription">' . zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($listing->fields['products_id'], $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION) : '') . '</div>';

NOTE: you should use your templates and overrides for this change ...

22 Nov 2010, 6:58 PM
#3
securit avatar

securit

New Zenner

Join Date:
Oct 2009
Location:
Nelson, NZ
Posts:
26
Plugin Contributions:
0

Re: Category description display on first page only

Hi thanks for that,

it was almost what I was looking for I didnt modify the products_listing.php but the tpl_index_product_list.php.

<?php
// categories_description
    if (($current_categories_description != '') & ( $_GET['page'] <= 1 )) {
?>
<div id="indexProductListCatDescription" class="content"><?php echo $current_categories_description;  ?></div>
<?php } 
// categories_description 
?>

Thanks for pointing me in the right direction :clap: