I am looking through Prestashop 1.7 and i want to overide the controller responsible for Products Listing ( aka Category Archive ). I am using the official Prestashop starter theme and i want to override the controller in order to get some more data to the sort-order.tpl
<div class="products-sort-order">
<span>{if isset($listing.sort_selected)}{$listing.sort_selected}{else}{l s='Sort by:' d='Shop.Theme.Global'}{/if}</span>
{foreach from=$sort_orders item=sort_order}
<a
class="{['current' => $sort_order.current, 'js-search-link' => true]|classnames}"
href="{$sort_order.url}"
rel="nofollow"
>
{$sort_order.label}
</a>
{/foreach}
</div>
In the above snippet there is a sort_order variable , part of a $listing variable comming from products-top.tpl
<div id="js-product-list-top" class="products-selection">
{if $listing.pagination.total_items|count > 1}
<p>{l s='There are %product_count% products.' d='Shop.Theme.Catalog' sprintf=['%product_count%' => $listing.pagination.total_items|count]}</p>
{elseif $listing.pagination.total_items > 0}
<p>{l s='There is 1 product.' d='Shop.Theme.Catalog'}</p>
{/if}
{block name='sort_by'}
{include file='catalog/_partials/sort-orders.tpl' sort_orders=$listing.sort_orders}
{/block}
{block name='pagination_summary'}
{l s='Showing %from%-%to% of %total% item(s)' d='Shop.Theme.Catalog' sprintf=[
'%from%' => $listing.pagination.items_shown_from ,
'%to%' => $listing.pagination.items_shown_to,
'%total%' => $listing.pagination.total_items
]}
{/block}
</div>
My goal is to override the responsible controller in order to generate some links to alter the resultsPerPage just like the $sort_order changes the listing order passing some parameters to the url. The problem is that althought i've search nearly all controllers , i did not find the one passing those data to the tpl. Due to the lack of proper documentation i am asking for a bit of "where-is-that" information from a more experienced dev Thanks in advance