*

Sergio1

  • **
  • 5 posts
Category description
« on: April 19, 2020, 12:02:06 PM »
Hello,

I need to include the category description on the category page on the front.
I have modified the following code in search.php, but it doesn't work ...

Can you help me?

Thanks!

Code: [Select]
<!-- HELPERS FORS AJAX SEARCH -->
<div id="ajax-help" style="display:none;">
<input type="hidden" name="ajax-last-page-id" value="<?php echo ceilosc_search_total_items() / osc_default_results_per_page_at_search() ); ?>" />
<?php
$search_cat_id 
osc_search_category_id();
$search_cat_id = isset($search_cat_id[0]) ? $search_cat_id[0] : '';
?>

</div>
<p><?php echo osc_search_category()['s_description']; ?></p>
<div id="search-items" data-loading="<?php _e('Loading listings...''starter'); ?>">
<?php if(osc_count_items() == 0) { ?>
<div class="list-empty round3" >
<img src="<?php echo osc_current_web_theme_url('images/search-empty.png'); ?>"/>
<div>

Marked as best answer by frosticek on April 21, 2020, 08:58:33 AM
*

MB Themes

Re: Category description
« Reply #1 on: April 20, 2020, 08:17:43 AM »
@Sergio1
Try:
Code: [Select]
$cat = Category::newInstance()->findByPrimaryKey($search_cat_id);
echo @$cat['s_description']


  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

Sergio1

  • **
  • 5 posts
Re: Category description
« Reply #2 on: April 20, 2020, 08:41:19 PM »
Thank you @MB Themes!!

Now is working!