Skip to main content

Category description in category listing

More
14 years 7 months ago #41560 by jansuhr
In a subcategory listing I would like to include the category description for those subcategories that are displayed in the list.

This is a code snippet from category/listing_list.php
Code:
<h3 class="hikashop_category_list_item<?php echo $class; ?>" <?php echo $width; ?>> <a href="<?php echo $link; ?>" > <?php echo $row->category_name; if($this->params->get('number_of_products',0)){ echo ' ('.$row->number_of_products.')'; } ?> </a> </h3>

I would like to have the description after the H3 tag.

Can you give me a hint on what code I should copy and paste in there.

Thanks

Jan

Please Log in or Create an account to join the conversation.

More
14 years 7 months ago #41687 by nicolas
It's quite simple:
<?php echo $row->category_description; ?>

Please Log in or Create an account to join the conversation.

More
14 years 7 months ago #41698 by jansuhr
Thanks for the clue, it made me make a custom field called "Short Description" since the main description for my categories in some case are too long for this view.

So my code is instead: <?php echo $row->short_description; ?>

Since this field falls in the "Additional Information" department I now have that line of text (Additional information) on the page under the main category name.

How can I get rid of that? Can't find any reference to it in the listing_list.php


Jan

Please Log in or Create an account to join the conversation.

More
14 years 7 months ago #41756 by jansuhr
I did remove the "Additional Information" with CSS, not so clean solution but it solved my problem.
Code:
.hikashop_category_custom_info_main {display: none;}

Jan

Please Log in or Create an account to join the conversation.

More
14 years 7 months ago #41879 by nicolas
You could turn off the front end display option of the custom field. Then you wouldn't have that "Additional Information" text displayed.
But CSS is fine too.

Please Log in or Create an account to join the conversation.

Time to create page: 0.154 seconds
Powered by Kunena Forum