how to add total results on the footer or pagination

  • Posts: 490
  • Thank you received: 2
8 years 1 month ago #268961

-- HikaShop version -- : 2.6.3
-- Joomla version -- : 3.4.3
-- PHP version -- : 5.5
-- Error-message(debug-mod must be tuned on) -- : none

hi

how can i display the total results on a page?

For example, i created a menu to hikashop product lisitng and selected a category for example shoe category. i named this menu link shoe category

how can i make the total products in that category visible on the page i made named shoe category when i click on the menu link.

i hope to display something like

100 results for shoe category

thank you

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

  • Posts: 83986
  • Thank you received: 13603
  • MODERATOR
8 years 1 month ago #268964

Hi,

The pagination displays like that by default:
monosnap.com/file/ZMC8IK89I9DTan84j5WLmPjQTS44rW
As you can see, it already contains the total number of elements of the listing.
If you don't see that, then it must be your template that overrides that display in order to display the pagination differently.
In that case, you'll have to change the file templates/YOUR_TEMPLATE/html/pagination.php

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

  • Posts: 490
  • Thank you received: 2
8 years 1 month ago #269131

thanks nick

can you please tell me how to access the object so i can echo it on the top page?

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

  • Posts: 83986
  • Thank you received: 13603
  • MODERATOR
8 years 1 month ago #269132

Hi,

It's quite easy. In the view files of the product view (listing, listing_div, etc), you can use such code:

<?php echo $this->pageInfo->elements->total; ?>

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

  • Posts: 490
  • Thank you received: 2
8 years 3 weeks ago #269892

thank you.

this is working.

i tried to use this code

<?php echo $this->pagination->getResultsCounter(); ?>

can i rearrange it to appear like so, including the category?

1-48 results for Clothing, Shoes & Jewelry : Stand-Out Girls' Sandals


also another issue is that it appears in modules as well. can we we it appear no the menu links only

thanks

Last edit: 8 years 3 weeks ago by ronron.

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

  • Posts: 83986
  • Thank you received: 13603
  • MODERATOR
8 years 3 weeks ago #269911

Hi,

You can do like that:

<?php if(!$this->module){ echo $this->pagination->getResultsCounter() . ' for '.$this->element->category_name; } ?>

The following user(s) said Thank You: ronron

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

  • Posts: 490
  • Thank you received: 2
8 years 3 weeks ago #270032

thanks nic

im having problems with products with more than 1 category. Nothing is appearing.

example i created a menu link > Categories listing > main category > editors pick

editors pick is of course a secondary category.

this menu link will not display any category

what could be the issue?

thanks again

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

  • Posts: 83986
  • Thank you received: 13603
  • MODERATOR
8 years 3 weeks ago #270033

Hi,

Please open new threads for new questions. And please provide adequate information. For example:
- link to the page
- screenshots of the settings of the menu item.
- screenshot of the categories listing of that category.
Only then, we can say something useful to help you.

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

Time to create page: 0.100 seconds
Powered by Kunena Forum