Jump to content

Recommended Posts


Je viens de me rendre compte d'un problème d’affichage sur mon site. 

Sur les catégories parentes il affiche tous les produits les uns sur les autres sur une colonne,  alors que sur les sous-catégories aucun problème.

Voici le code de mon fichier category.tpl

Je suis sous presta 1.7.5

Vous comprenez le souci?

Petite précision, dans le logiciel Brackets il me met en rouge cette ligne 

<div class="jhp-sub-category-wrapper col-xs-6 col-sm-3 col-md-2 col-lg-2 col-xl-1">

ainsi que le dernier </div>


Merci beaucoup

 * 2007-2019 PrestaShop
 * 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 license@prestashop.com so we can send you a copy immediately.
 * 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 http://www.prestashop.com for more information.
 * @author    PrestaShop SA <contact@prestashop.com>
 * @copyright 2007-2019 PrestaShop SA
 * @license   https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
 * International Registered Trademark & Property of PrestaShop SA
{extends file='catalog/listing/product-list.tpl'}

{block name='product_list_header'}
		<div class="block-category card card-block clearfix jhp-category-block-wrapper">
			<div class="jhp-all-page-main-title-wrapper">
				<div class="jhp-all-page-main-title">{$category.name}</div>
			{if $category.description}
				<div id="category-description" class="text-muted col-md-7">{$category.description nofilter}</div>
            {if $category.image.large.url}
				<div class="jhp-category-cover col-md-5">
					<img src="{$category.image.large.url}" alt="{if !empty($category.image.legend)}{$category.image.legend}{else}{$category.name}{/if}">
		{* <div class="text-sm-center hidden-md-up">
			<h1 class="h1">{$category.name}</h1>
		</div> *}	

		{$jhp_child_category = Category::getChildren($category['id'], $language.id)}
		{if count($jhp_child_category) > 0}
		<div class='jhp-category-main-div clearfix'>
			<div class="jhp-main-category-title-wrapper">
				<div class="jhp-sub-category-title">{l s='Sous-catégories' d='Shop.Theme.Catalog'}</div>
			{$count_cat = 1}
			{foreach $jhp_child_category as $category}
				{if $count_cat <= 5}
				<div class="jhp-sub-category-wrapper col-xs-6 col-sm-3 col-md-2 col-lg-2 col-xl-1">
					<div class="jhp-category-image">
                        <a href="{$link->getCategoryLink($category.id_category, $category.link_rewrite)|escape:'html':'UTF-8'}" title="{$category.name|escape:'html':'UTF-8'}" class="img">
							{$tmp = {url entity='categoryImage' id=$category.id_category name='category_default'}}
							{if !file_exists({$tmp})}
								<img class="replace-2x" src="{$tmp}" alt="{$category.name|escape:'html':'UTF-8'}"  />
					<div class="jhpcategory-name">
						<a class="category-name" href="{$link->getCategoryLink($category.id_category, $category.link_rewrite)|escape:'html':'UTF-8'}">{$category.name|escape:'html':'UTF-8'}</a>
				{$count_cat = $count_cat + 1}


Edited by @rthur
typo (see edit history)

Share this post

Link to post
Share on other sites

C'est bon j'ai trouvé c'était la partie cachée entre commentaires qui est nécessaire dans le code.

Edited by @rthur (see edit history)

Share this post

Link to post
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...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More