Category description in category listing

  • Posts: 182
  • Thank you received: 15
12 years 10 months ago #41560

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

<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.

  • Posts: 83103
  • Thank you received: 13416
  • MODERATOR
12 years 10 months ago #41687

It's quite simple:
<?php echo $row->category_description; ?>

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

  • Posts: 182
  • Thank you received: 15
12 years 10 months ago #41698

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.

  • Posts: 182
  • Thank you received: 15
12 years 10 months ago #41756

I did remove the "Additional Information" with CSS, not so clean solution but it solved my problem.

.hikashop_category_custom_info_main {display: none;}

Jan

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

  • Posts: 83103
  • Thank you received: 13416
  • MODERATOR
12 years 10 months ago #41879

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.055 seconds
Powered by Kunena Forum