I have after some search found a solution to my old problem:
I have a lot of products and use pagination. Wenn i enter a product and return, then the pagination is allways at the beginning.
The solution is quit simple:
1) Store the limitstart in the session at category/view.html.php:
// Hole den aktuellen `limitstart`-Wert aus der URL und speichere ihn in der Session
$limitstart = $app->input->getInt('limitstart', 0);
$app->setUserState('com_phocacart.category.limitstart', $limitstart);
$this->t['limitstart'] = $limitstart;
$this->t['pagination'] = $model->getPagination($this->t['categoryid']);
2) Füge in der item/tmpl/default.php folgenden Code hinzu:
// Hole den `limitstart`-Wert aus der Session, falls er nicht in der URL vorhanden ist
$app = Factory::getApplication();
$limitstart = $app->input->getInt('limitstart', $app->getUserState('com_phocacart.category.limitstart', 0));
3) Passe den Rücksprung-Link in item/tmpl/default.php wie folgt an:
// Hole den `limitstart`-Wert, entweder aus der URL oder aus der Session
$limitstart = Factory::getApplication()->input->getInt('limitstart', Factory::getApplication()->getUserState('com_phocacart.category.limitstart', 0));
if (isset($this->category[0]->id)) {
$linkUp = Route::_(PhocacartRoute::getCategoryRoute($this->category[0]->id, $this->category[0]->alias) . '&limitstart=' . $limitstart);
echo '<a href="' . $linkUp . '">Zurück zur Kategorie</a>';
}
// Note: this is only a link, can easily be adjusted to be a button.
May be this can be added to the final Version Joomla 5? It would be a graet jump vorwards?
Jump back to the same pagination site
-
- Phoca Member
- Posts: 28
- Joined: 06 Jan 2020, 11:35
- Jan
- Phoca Hero
- Posts: 48386
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: Jump back to the same pagination site
Hi, thank you for the info, I will talk to other developers about this, to be sure, it is not in conflict somewhere.
Thank you, Jan
Thank you, Jan
If you find Phoca extensions useful, please support the project
-
- Phoca Member
- Posts: 10
- Joined: 24 Mar 2011, 15:51
Re: Jump back to the same pagination site
Hi,
what about to use just simple <a href="javascript:history.go(-1)">Back to products list</a>
what about to use just simple <a href="javascript:history.go(-1)">Back to products list</a>
Last edited by Cony on 06 Nov 2024, 02:16, edited 1 time in total.
-
- Phoca Member
- Posts: 10
- Joined: 24 Mar 2011, 15:51
Re: Jump back to the same pagination site
Or, use $_SERVER['HTTP_REFERER']...
-
- Phoca Professional
- Posts: 189
- Joined: 12 Feb 2015, 13:30