*

Fabio Massaro

  • *****
  • 306 posts
Hi can you help me understand how I can put this
« on: November 06, 2022, 09:47:04 AM »
Hi can you help me understand how I can put this
« Last Edit: November 06, 2022, 09:48:48 AM by Fabio Massaro »

*

cartagena68

  • ***
  • 71 posts
Re: Hi can you help me understand how I can put this
« Reply #1 on: November 06, 2022, 03:58:06 PM »
osc_category_total_items() – Gets the total items related with the current category

*

Fabio Massaro

  • *****
  • 306 posts
Re: Hi can you help me understand how I can put this
« Reply #2 on: November 06, 2022, 04:46:16 PM »
osc_category_total_items() – Gets the total items related with the current category

Can you give me the complete code and where to enter it please

*

cartagena68

  • ***
  • 71 posts
Re: Hi can you help me understand how I can put this
« Reply #3 on: November 06, 2022, 05:07:14 PM »
Il codice dovrebbe essere tipo questo
Code: [Select]
<?php if(osc_category_total_items()) { echo osc_category_total_items() . ' annunci ' osc_category_name();} ?>
Per il dove metterlo non conosco il tuo tema, dovrebbe essere in search.php nel punto dove vuoi farlo vedere.
Questo da il totale di annunci nella categoria, comprese le sotto categorie

*

Fabio Massaro

  • *****
  • 306 posts
Re: Hi can you help me understand how I can put this
« Reply #4 on: November 06, 2022, 05:22:29 PM »
Il codice dovrebbe essere tipo questo
Code: [Select]
<?php if(osc_category_total_items()) { echo osc_category_total_items() . ' annunci ' osc_category_name();} ?>
Per il dove metterlo non conosco il tuo tema, dovrebbe essere in search.php nel punto dove vuoi farlo vedere.
Questo da il totale di annunci nella categoria, comprese le sotto categorie

but I want to see the subcategories of that category

*

cartagena68

  • ***
  • 71 posts
Re: Hi can you help me understand how I can put this
« Reply #5 on: November 06, 2022, 07:18:06 PM »
You can try this code
Code: [Select]
<?php echo osc_search_total_items() . ' annunci ' search_title(); ?>

*

Fabio Massaro

  • *****
  • 306 posts
Re: Hi can you help me understand how I can put this
« Reply #6 on: November 09, 2022, 09:43:00 PM »
Hi I tried to enter this code but it is not what I am looking for

*

Dan

  • ***
  • 52 posts
Re: Hi can you help me understand how I can put this
« Reply #7 on: November 10, 2022, 05:30:54 AM »
This is what I use

Add this to your search.php where you want to buttons to show

<?php $cat = Category::newInstance()->findByPrimaryKey($search_cat_id);
echo @$cat['s_description']; ?>

Then go to admin panel settings main categories and dit one by one add this codes and links of subcategories


<!DOCTYPE html>
<html>
<head>
<style>
.button {
  background-color: #ff0000; /* Green */
  border: none;
  color: white;
  padding: 3px 6px;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  font-size: 12px;
  margin: 4px 2px;
  cursor: pointer;
}

</style>
</head>
<body>

<a href="https://yourweb.com/category-name/subcategory-name"><button class="button">Laptop</button></a>

<a href="https://yourweb.com/electronics/audio-music-equipment"><button class="button button">audio and music</button></a>

<a href="https://yourweb.com/categor/subcategory name"><button class="button button"> sub cat name</button></a>


</body>
</html>


This is what I use on my website you can change the could of the buttons and and sizes as well

« Last Edit: November 10, 2022, 05:33:17 AM by Dan »

*

Fabio Massaro

  • *****
  • 306 posts
Re: Hi can you help me understand how I can put this
« Reply #8 on: November 12, 2022, 09:20:57 AM »
I cannot understand this passage
Which folder should I go to
on oc-admin - categories.php or on oc-contet - theme - delta - admin-categories.php

Then go to admin panel settings main categories and dit one by one add this codes and links of subcategorie

*

Dan

  • ***
  • 52 posts
Re: Hi can you help me understand how I can put this
« Reply #9 on: November 12, 2022, 07:10:41 PM »
Login to your admin section>settings >categories
And insert those codes that's all

*

Fabio Massaro

  • *****
  • 306 posts
Re: Hi can you help me understand how I can put this
« Reply #10 on: November 12, 2022, 07:55:32 PM »
sorry I'm on category settings but the code where I put them https://prnt.sc/qfueWzP4sDQT

*

Dan

  • ***
  • 52 posts
Re: Hi can you help me understand how I can put this
« Reply #11 on: November 12, 2022, 11:06:01 PM »
Click edit category and add it to description

*

Fabio Massaro

  • *****
  • 306 posts
Re: Hi can you help me understand how I can put this
« Reply #12 on: November 13, 2022, 11:20:36 AM »
Click edit category and add it to description

Thanks for help I hope to change the favor too