prestashop show all products in category code example

Example 1: prestashop show all products in category

{if !empty($smarty.get.order)}
        {capture assign='ordering'}order={$smarty.get.order}&{/capture}
    {else}
        {assign var='ordering' value=''}
    {/if}

    {if !empty($smarty.get.resultsPerPage)}
        {assign var='results_per_page' value=$smarty.get.resultsPerPage}
    {else}
        {assign var='results_per_page' value=25}
    {/if}

Example 2: prestashop show all products in category

<label style="float:left;margin-right: 15px" class="form-control-label hidden-sm-down sort-label">{l s='Products per page:'}</label>
<div style="float:left;" class="sort-select dropdown js-dropdown">
    <a class="custom-select select-title" rel="nofollow" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
        {$results_per_page}
    </a>
    <div class="dropdown-menu">
        <a rel="nofollow" href="?{$ordering}resultsPerPage=25" class="dropdown-item js-search-link">
            25
        </a>
        <a rel="nofollow" href="?{$ordering}resultsPerPage=50" class="dropdown-item js-search-link">
            50
        </a>
        <a rel="nofollow" href="?{$ordering}resultsPerPage=75" class="dropdown-item js-search-link">
            75
        </a>
        <a rel="nofollow" href="?{$ordering}resultsPerPage=100" class="dropdown-item js-search-link">
            100
        </a>
    </div>
</div>

Example 3: prestashop show all products in category

if ($resultsPerPage <= 0 || $resultsPerPage > 100) {
    $resultsPerPage = Configuration::get('PS_PRODUCTS_PER_PAGE');
}

Example 4: prestashop show all products in category

if ($resultsPerPage <= 0 || $resultsPerPage > 36) {
    $resultsPerPage = Configuration::get('PS_PRODUCTS_PER_PAGE');
}

Tags:

Misc Example