Skip to main content

disable pagination memory

More
13 years 5 months ago #99588 by Dodesign
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.

More
13 years 5 months ago #99786 by nicolas
Replied by nicolas on topic disable pagination memory
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.

More
13 years 5 months ago #99816 by nicolas
Replied by nicolas on topic disable pagination memory
Change the code:
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:
Code:
$pageInfo->limit->value = JRequest::getVar('limitstart_'.$this->params->get('main_div_name').$category_selected,0);
and:
Code:
$pageInfo->limit->start = $app->getUserStateFromRequest( $this->paramBase.'.limitstart', 'limitstart_'.$this->params->get('main_div_name').$category_selected, 0, 'int' );
to:
Code:
$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.

More
13 years 5 months ago #99849 by Dodesign
Replied by Dodesign on topic disable pagination memory
it's two lines with
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); }
on line 309 and 375

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

More
13 years 2 months ago #113766 by alikon1
Replied by alikon1 on topic disable pagination memory
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.

More
13 years 2 months ago #113838 by nicolas
Replied by nicolas on topic disable pagination memory
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.

More
13 years 3 weeks ago #122537 by DeeEmm
Replied by DeeEmm on topic disable pagination memory
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.

More
13 years 3 weeks ago #122542 by DeeEmm
Replied by DeeEmm on topic disable pagination memory
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.

More
13 years 3 weeks ago #122544 by DeeEmm
Replied by DeeEmm on topic disable pagination memory
To disable only the pagination memory it's just the second part - change
Code:
$pageInfo->limit->start = $app->getUserStateFromRequest( $this->paramBase.'.limitstart', 'limitstart_'.$this->params->get('main_div_name').$category_selected, 0, 'int' );

to:
Code:
$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.220 seconds
Powered by Kunena Forum