Skip to main content

Any way to change the number of products shown?

More
12 years 11 months ago #126502 by Shulha
Hi there! I wander if there's any way to change overall quantity shown by the
Code:
hikashop_results_counter
for example to add a number or to reduce it by some number?
I got a PHP developer and he's stuck with it and I guess we need your commentary upon that.
We need simply the Overall Quantity Plus any number

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

More
12 years 11 months ago #126533 by nicolas
Hi,

The best I think is to edit the file "listing" of the view "product" via the menu Display>Views and add such code at the beginning:
Code:
<?php $suffix = $this->pagination->hikaSuffix; $this->pagination = hikashop_get('helper.pagination', $this->pageInfo->elements->total+$xxx, $this->pageInfo->limit->start, $this->pageInfo->limit->value); $this->pagination->hikaSuffix = $suffix; ?>
where $xxx is a variable with the number that you want to add to the total.

This will reset the pagination system for the listing with a new total before the pagination gets displayed using it.

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

More
12 years 11 months ago - 12 years 11 months ago #129795 by Shulha

nicolas wrote: Hi,

The best I think is to edit the file "listing" of the view "product" via the menu Display>Views and add such code at the beginning:

Code:
<?php $suffix = $this->pagination->hikaSuffix; $this->pagination = hikashop_get('helper.pagination', $this->pageInfo->elements->total+$xxx, $this->pageInfo->limit->start, $this->pageInfo->limit->value); $this->pagination->hikaSuffix = $suffix; ?>
where $xxx is a variable with the number that you want to add to the total.

This will reset the pagination system for the listing with a new total before the pagination gets displayed using it.


Thank you! It works but it also touches the counter of the "related products" on the product page. Any way to fix that?
Last edit: 12 years 11 months ago by Shulha.

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

More
12 years 11 months ago #129867 by nicolas
Simply add a check on the task parameter like that:
Code:
<?php if($_REQUEST['task']!='show'){ $suffix = $this->pagination->hikaSuffix; $this->pagination = hikashop_get('helper.pagination', $this->pageInfo->elements->total+$xxx, $this->pageInfo->limit->start, $this->pageInfo->limit->value); $this->pagination->hikaSuffix = $suffix; } ?>

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

More
12 years 10 months ago #133985 by Shulha

nicolas wrote: Simply add a check on the task parameter like that:

Code:
<?php if($_REQUEST['task']!='show'){ $suffix = $this->pagination->hikaSuffix; $this->pagination = hikashop_get('helper.pagination', $this->pageInfo->elements->total+$xxx, $this->pageInfo->limit->start, $this->pageInfo->limit->value); $this->pagination->hikaSuffix = $suffix; } ?>


It helped but now I noticed that the same things goes on when you do the filtering... Despite the fact that only 5 products match the filtering criteria, it shows that there are these 5products +XXX number that I added and there are 8 pages in the pagionation. Could you please help me to fix that?

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

More
12 years 10 months ago #134096 by Xavier
Hi,

You can try to add this code after that one:
Code:
if(hikashop_level(2) && JRequest::getVar('hikashop_front_end_main',0) && JRequest::getVar('task','listing')=='listing' && $display_filters=='1'){ $this->setLayout('filter'); $htmlFilter = $this->loadTemplate(); }

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

More
12 years 8 months ago #140649 by Shulha

Xavier wrote: Hi,

You can try to add this code after that one:

Code:
if(hikashop_level(2) && JRequest::getVar('hikashop_front_end_main',0) && JRequest::getVar('task','listing')=='listing' && $display_filters=='1'){ $this->setLayout('filter'); $htmlFilter = $this->loadTemplate(); }


This code didnt help. I still get the same error:

Despite the fact that only 5 products match the filtering criteria, it shows that there are these 5products +XXX number that I added and there are 8 pages in the pagionation

Could you please help me? I need this quite much.

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

More
12 years 8 months ago #140726 by nicolas
Instead of the code:
Code:
<?php if($_REQUEST['task']!='show'){ $suffix = $this->pagination->hikaSuffix; $this->pagination = hikashop_get('helper.pagination', $this->pageInfo->elements->total+$xxx, $this->pageInfo->limit->start, $this->pageInfo->limit->value); $this->pagination->hikaSuffix = $suffix; } ?>
you should try that code:
Code:
<?php if($_REQUEST['task']!='show' && $_REQUEST['Itemid']!=YYY){ $suffix = $this->pagination->hikaSuffix; $this->pagination = hikashop_get('helper.pagination', $this->pageInfo->elements->total+$xxx, $this->pageInfo->limit->start, $this->pageInfo->limit->value); $this->pagination->hikaSuffix = $suffix; } ?>
where YYY is the id of the menu item that you use for the filters search results display page.

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

Time to create page: 0.195 seconds
Powered by Kunena Forum