Advertisement:

Author Topic: How to count item number for categories and show it for Azurro Theme;  (Read 100 times)

muratbora

  • Sr. Member
  • ****
  • Posts: 261
How to count item number for categories and show it for Azurro Theme;
On main page right side it show whole list of parent categories, but I want it also show number of items. How to do it?

See secreenshoot;

vivekshan

  • Full Member
  • ***
  • Posts: 113
Re: How to count item number for categories and show it for Azurro Theme;
« Reply #1 on: September 15, 2019, 09:56:42 pm »
where is the screenshot ?

muratbora

  • Sr. Member
  • ****
  • Posts: 261
Re: How to count item number for categories and show it for Azurro Theme;
« Reply #2 on: September 16, 2019, 10:14:29 am »
Here forum page gave error while loading secreenshoot;
500 Internal Server Error
nginx/1.13.3


****

Here url of site ; https://www.turkeycarrentalcompany.com/index.php

I want that right side located categories should indicate / count number of items ( like BENDER theme homepage )
« Last Edit: September 16, 2019, 05:22:19 pm by muratbora »

vivekshan

  • Full Member
  • ***
  • Posts: 113
Re: How to count item number for categories and show it for Azurro Theme;
« Reply #3 on: September 16, 2019, 09:58:50 pm »
I want to know that you have shown categories on page through function or done manually

if done through function show me the code

if manually you have printed categories then i should create function to print items count

muratbora

  • Sr. Member
  • ****
  • Posts: 261
Re: How to count item number for categories and show it for Azurro Theme;
« Reply #4 on: September 17, 2019, 12:26:52 am »
shown categories on page through function !

<div id="sidebar">
<div class="category-box">
 <?php osc_run_hook('sidebar-catmain-azzurro'); ?>

</div>

****

I saw only above code for related place / section on main.php

Here whole code of page;

<?php

    /*

     *      Osclass – software for creating and publishing online classified

     *                           advertising platforms

     *

     *                        Copyright (C) 2014 OSCLASS

     *

     *       This program is free software: you can redistribute it and/or

     *     modify it under the terms of the GNU Affero General Public License

     *     as published by the Free Software Foundation, either version 3 of

     *            the License, or (at your option) any later version.

     *

     *     This program is distributed in the hope that it will be useful, but

     *         WITHOUT ANY WARRANTY; without even the implied warranty of

     *        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the

     *             GNU Affero General Public License for more details.

     *

     *      You should have received a copy of the GNU Affero General Public

     * License along with this program.  If not, see <http://www.gnu.org/licenses/>.

     */



    // meta tag robots

    osc_add_hook('header','azzurro_follow_construct');



    azzurro_add_body_class('home');





    $buttonClass = '';

    $listClass   = '';

    if(azzurro_show_as() == 'gallery'){

          $listClass = 'listing-grid';

          $buttonClass = 'active';

    }

?>



<?php osc_current_web_theme_path('header.php') ; ?>

<div class="clear"></div>
   
<div class="latest_ads">

<h1><strong><?php _e('Latest Listings', 'azzurro') ; ?></strong></h1>

 <?php if( osc_count_latest_items() == 0) { ?>

    <div class="clear"></div>

    <p class="empty"><?php _e("There aren't listings available at this moment", 'azzurro'); ?></p>

<?php } else { ?>

    <div class="actions">

      <span class="doublebutton <?php echo $buttonClass; ?>">

           <a target="_blank" href="<?php echo osc_base_url(true); ?>?sShowAs=list" class="list-button" data-class-toggle="listing-grid" data-destination="#listing-card-list"><span><?php _e('List', 'azzurro'); ?></span></a>

           <a target="_blank" href="<?php echo osc_base_url(true); ?>?sShowAs=gallery" class="grid-button" data-class-toggle="listing-grid" data-destination="#listing-card-list"><span><?php _e('Grid', 'azzurro'); ?></span></a>

      </span>

    </div>

    <?php

    View::newInstance()->_exportVariableToView("listType", 'latestItems');

    View::newInstance()->_exportVariableToView("listClass",$listClass);

    osc_current_web_theme_path('loop.php');

    ?>

    <div class="clear"></div>

    <?php if( osc_count_latest_items() == osc_max_latest_items() ) { ?>

        <p class="see_more_link"><a target="_blank" href="<?php echo osc_search_show_all_url() ; ?>">

            <strong><?php _e('See all listings', 'azzurro') ; ?> &raquo;</strong></a>

        </p>

    <?php } ?>

<?php } ?>

<div class="see_more_link">
</div>
</div><!-- main -->
<div id="sidebar">
<div class="category-box">
 <?php osc_run_hook('sidebar-catmain-azzurro'); ?>

</div>

        <?php if( osc_get_preference('sidebar-300x250', 'italia_azzurro') != '') {?>

    <!-- sidebar ad 350x250 -->

    <div class="vista_300">

        <?php echo osc_get_preference('sidebar-300x250', 'italia_azzurro'); ?>

    </div><div class="widget-box">

    <!-- /sidebar ad 350x250 -->

    <?php } else { echo '<div class="widget-box col-12">'; }?>



    <?php if(osc_count_list_regions() > 0 ) { ?>

        <div class="box-location">

            <h3><strong><?php _e("Location", 'italia_azzurro') ; ?></strong></h3>

            <ul>

            <?php while(osc_has_list_regions() ) { ?>

                <li><a target="_blank" href="<?php echo osc_list_region_url(); ?>"><?php echo osc_list_region_name() ; ?> <em>(<?php echo osc_list_region_items() ; ?>)</em></a></li>

            <?php } ?>

            </ul>

        </div>

        <?php } ?>



    </div>
</div>

<div class="clear"><!-- do not close, use main clossing tag for this case -->

<?php if( osc_get_preference('homepage-728x90', 'azzurro') != '') { ?>

<!-- homepage ad 728x60-->

<div class="vista_728">

    <?php echo osc_get_preference('homepage-728x90', 'azzurro'); ?>

</div>

<!-- /homepage ad 728x60-->

<?php } ?>

<?php osc_current_web_theme_path('footer.php') ; ?>



vivekshan

  • Full Member
  • ***
  • Posts: 113
Re: How to count item number for categories and show it for Azurro Theme;
« Reply #5 on: September 17, 2019, 09:21:21 pm »
codes are not there in main.php
its in functions.php

anyway your categories have item counts but now showing on page

you can open your website and then press Crtl + U then check its showing

muratbora

  • Sr. Member
  • ****
  • Posts: 261
Re: How to count item number for categories and show it for Azurro Theme;
« Reply #6 on: September 18, 2019, 12:24:13 pm »
Yes in source code I can see it is showing item calculation ;

****
<li>
<a class="category sub-category port-rent-a-car" href="https://www.turkeycarrentalcompany.com/rent-a-car/port-rent-a-car">Port Rent A Car</a> <span>(5)</span>

****

but on front page I can not see it, probably it is disabled in css file than, I will check it..

muratbora

  • Sr. Member
  • ****
  • Posts: 261
Re: How to count item number for categories and show it for Azurro Theme;
« Reply #7 on: September 18, 2019, 12:41:51 pm »
Yes it is hidden into Css file ;
command was ; .r-list li span {display:none }

I have changed as {display:inline }

Now it shows item count for main categories but not subcategories,
I could not find it