disable pagination memory

  • Posts: 59
  • Thank you received: 0
11 years 6 months ago #99588

how can i disable remembering pagination in hikashop?
for example:
1) i'm click on some category in categories menu.
2) then click any page in pagination(for example, 3)
3) go to any other page
4) when i return in same category i'm see third page, but i need to see first.
Is it possible to fix?

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

  • Posts: 82725
  • Thank you received: 13338
  • MODERATOR
11 years 6 months ago #99786

There is nothing to fix as it's not a bug, it's normal that it works like that.

If you want to change that behavior, you will have to modify several lines of code in several HikaShop core files.
Please give links to the pages where you have listings where you want to change that so that we can tell you more exactly what you can do.

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

  • Posts: 82725
  • Thank you received: 13338
  • MODERATOR
11 years 6 months ago #99816

Change the code:

$oldValue = $app->getUserState($this->paramBase.'.list_limit');
				if(empty($oldValue)){
					$oldValue = $this->params->get('limit');
				}
				$pageInfo->limit->value = $app->getUserStateFromRequest( $this->paramBase.'.list_limit', 'limit_'.$this->params->get('main_div_name').$category_selected, $this->params->get('limit'), 'int' );
				if($oldValue!=$pageInfo->limit->value){
					JRequest::setVar('limitstart_'.$this->params->get('main_div_name').$category_selected,0);
				}
to:
$pageInfo->limit->value = JRequest::getVar('limitstart_'.$this->params->get('main_div_name').$category_selected,0);
and:
$pageInfo->limit->start = $app->getUserStateFromRequest( $this->paramBase.'.limitstart', 'limitstart_'.$this->params->get('main_div_name').$category_selected, 0, 'int' );
to:
$pageInfo->limit->start = JRequest::getInt('limitstart_'.$this->params->get('main_div_name').$category_selected, 0 );
in the file components/com_hikashop/views/product/view.html.php and that should do what you want.

The following user(s) said Thank You: DeeEmm

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

  • Posts: 59
  • Thank you received: 0
11 years 6 months ago #99849

it's two lines with

$oldValue = $app->getUserState($this->paramBase.'.list_limit');
				if(empty($oldValue)){
					$oldValue = $this->params->get('limit');
				}
				$pageInfo->limit->value = $app->getUserStateFromRequest( $this->paramBase.'.list_limit', 'limit_'.$this->params->get('main_div_name').$category_selected, $this->params->get('limit'), 'int' );
				if($oldValue!=$pageInfo->limit->value){
					JRequest::setVar('limitstart_'.$this->params->get('main_div_name').$category_selected,0);
				}
on line 309 and 375

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

  • Posts: 177
  • Thank you received: 5
11 years 3 months ago #113766

Dodesign, I changed only second and it works.

But not only pagination remembered. Selected filter remember too. How to disable it? So each time I open category, it has no filter applied.

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

  • Posts: 82725
  • Thank you received: 13338
  • MODERATOR
11 years 3 months ago #113838

Regarding the filters, you can do like that:
www.hikashop.com/en/forum/2-general-talk...mechanics.html#98232

The following user(s) said Thank You: alikon1

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

  • Posts: 114
  • Thank you received: 14
11 years 1 month ago #122537

I found that if I made the replacements as described in post above the pagination was removed and the filter changed to 100.

So instead I simply commented out the two instances of

JRequest::setVar('limitstart_'.$this->params->get('main_div_name').$category_selected,0);

Now I always go to first page when revisiting the page.

/DM

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

  • Posts: 114
  • Thank you received: 14
11 years 1 month ago #122542

Seems I spoke too soon. now no longer working :(

Will try above mod again.

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

  • Posts: 114
  • Thank you received: 14
11 years 1 month ago #122544

To disable only the pagination memory it's just the second part - change

$pageInfo->limit->start = $app->getUserStateFromRequest( $this->paramBase.'.limitstart', 'limitstart_'.$this->params->get('main_div_name').$category_selected, 0, 'int' );

to:
$pageInfo->limit->start = JRequest::getInt('limitstart_'.$this->params->get('main_div_name').$category_selected, 0 );

in the file components/com_hikashop/views/product/view.html.php

The following user(s) said Thank You: nicolas

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

Time to create page: 0.091 seconds
Powered by Kunena Forum