Jump to content

Modification pages liste produits ?page=X


Recommended Posts

Bonjour à tous,
Savez-vous dans quel fichier je peux modifier le contenu des pages de liste produits de type ?page=X.
On accède à ces pages en cliquant sur 2, 3 > etc... lorsque les produits ne tiennent pas en une seule page.

Mon souci est que sur ma page 1 de listing produits de type catégorie produit, j'ai l'affichage de mon product list header avec le titre H1 alors qu'en page 2 ou 3 etc... des produits celui-ci disparait.
Je voudrais donc également mettre mon titre etc... sur toutes les pages.

Merci pour votre aide !
Cordialement

 

Link to comment
Share on other sites

Bonjour,

Chez moi (version 1.7.6.5), j'ai un template products-top.tpl dans nom-du-dir-app/themes/classic/templates/catalog/_partials/.

Je vous le met ci-dessous

{** * 2007-2019 PrestaShop and Contributors * * NOTICE OF LICENSE * * This source file is subject to the Academic Free License 3.0 (AFL-3.0) * that is bundled with this package in the file LICENSE.txt. * It is also available through the world-wide-web at this URL: * https://opensource.org/licenses/AFL-3.0 * If you did not receive a copy of the license and are unable to * obtain it through the world-wide-web, please send an email * to [email protected] so we can send you a copy immediately. * * DISCLAIMER * * Do not edit or add to this file if you wish to upgrade PrestaShop to newer * versions in the future. If you wish to customize PrestaShop for your * needs please refer to https://www.prestashop.com for more information. * * @author PrestaShop SA * @copyright 2007-2019 PrestaShop SA and Contributors * @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0) * International Registered Trademark & Property of PrestaShop SA *}
{if $listing.pagination.total_items > 1}
{l s='There are %product_count% products.' d='Shop.Theme.Catalog' sprintf=['%product_count%' => $listing.pagination.total_items]}

{elseif $listing.pagination.total_items > 0}
{l s='There is 1 product.' d='Shop.Theme.Catalog'}

{/if}
{block name='sort_by'} {include file='catalog/_partials/sort-orders.tpl' sort_orders=$listing.sort_orders} {/block} {if !empty($listing.rendered_facets)}
{l s='Filter' d='Shop.Theme.Actions'}
{/if}
{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 ]}

Si vous le mettez là-dedans (dans le traitement du if $listing.pagination.total_items > 1), il sera le même sur toutes les pages du catalogue.

Est-ce que ce titre doit changer (selon les catégories de produits par exemple)?

C'est possible d'avoir une petite capture d'écran avec le titre en question?

Edited by Laetitia Bordon (see edit history)
Link to comment
Share on other sites

Merci pour votre retour.

J'ai l'impression que cette partie de code ne concerne que la phrase du nombre de produits affichés. Ayant désactivé cette balise via les CSS, cela ne m'avance guère ;)
En fait en pagination > 0 j'ai bien le titre de ma catégorie de produits qui s'affiche via la balise H1 mais dès que je passe en pagination > 1 le titre disparait.
Or je voudrais qu'il apparaisse également en pagination > 1 :)

Merci pour votre aide !

Link to comment
Share on other sites

C'est bon j'ai trouvé :)
En fait dans le fichier category-header.tpl j'avais cette ligne de code :

<div id="js-product-list-header">
    {if $listing.pagination.items_shown_from == 1}
        <div class="block-category card card-block">
            <h1 class="h1">{$category.name}</h1> etc...

J'ai du coup remplacé le {if $listing.pagination.items_shown_from == 1} par {if $listing.pagination.items_shown_from >= 1} :D

Merci pour votre aide !
Cordialement

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...