Hello everyone,
I have already added pagination inside product edit page in admin panel of cs-cart version 4.18.x. Everything is working fine (items per page, 10-20-50 and so on). My goal is to keep those choices I have made to all my products… For example, I chose to display 50 items per page but If I navigate to another product the pagination is 10 items per page… How could I add this values to sessions, according to cs-cart?
I tried some code but could not get it done… for example I have sothing like this:
$params = $_REQUEST;
if (!empty($_REQUEST['items_per_page'])) {
Registry::set('session.item_per_page', $_REQUEST['items_per_page']);
}
$params['page'] = (empty($_REQUEST['page'])) ? 1 : $_REQUEST['page'];
$params['items_per_page'] = !empty(Registry::get('session.item_per_page')) ? Registry::get('session.item_per_page') : 10;
$offset = ($params['page'] - 1) * $params['items_per_page'];
I do not know if makes any sense, but looking for a hint… Am I setting up correctly the session variable? Am I missing something?
thanks in advance