chantal.herman Posted March 18, 2013 Share Posted March 18, 2013 (edited) [Resolu] Bonjour, J'ai copié le homefeatured.tpl d'un site web que j'ai créé sous prestashop vers un nouveau thème d'un nouveau site "www.philippe-emery.fr". Mais voilà, le module produit phare m'affiche 1 produit par ligne, or j'ai regardé et il n'y a pas "l'air" d'avoir d'erreurs.. <!-- MODULE Home Featured Products --> <div id="featured_products"> <h4>{l s='Featured products' mod='homefeatured'}</h4> {if isset($products) AND $products} <div class="block_content"> {assign var='liHeight' value=100} {assign var='nbItemsPerLine' value=4} {assign var='nbLi' value=$products|@count} {math equation="nbLi/nbItemsPerLine" nbLi=$nbLi nbItemsPerLine=$nbItemsPerLine assign=nbLines} {math equation="nbLines*liHeight" nbLines=$nbLines|ceil liHeight=$liHeight assign=ulHeight} <ul > {foreach from=$products item=product name=homeFeaturedProducts} {math equation="(total%perLine)" total=$smarty.foreach.homeFeaturedProducts.total perLine=$nbItemsPerLine assign=totModulo} {if $totModulo == 0}{assign var='totModulo' value=$nbItemsPerLine}{/if} <li class="ajax_block_product {if $smarty.foreach.homeFeaturedProducts.iteration is div by 4} omega{/if} num-{$smarty.foreach.homeFeaturedProducts.iteration}"> <a class="product_image" href="{$product.link}" title="{$product.name|escape:html:'UTF-8'}" class="product_image"> <img src="{$link->getImageLink($product.link_rewrite, $product.id_image, 'home_default')}" alt="{$product.name|escape:html:'UTF-8'}" /> </a> <div class="featured_box"> <h5><a class="product_link" href="{$product.link}" title="{$product.name|truncate:50:'...'|escape:'htmlall':'UTF-8'}">{$product.name|truncate:55:'...'|escape:'htmlall':'UTF-8'}</a></h5> {if $product.show_price AND !isset($restricted_country_mode) AND !$PS_CATALOG_MODE}<p class="price_container"><span class="price">{if !$priceDisplay}{convertPrice price=$product.price}{else}{convertPrice price=$product.price_tax_exc}{/if}</span></p>{else}{/if} <div class="clear"></div> {if ($product.id_product_attribute == 0 OR (isset($add_prod_display) AND ($add_prod_display == 1))) AND $product.available_for_order AND !isset($restricted_country_mode) AND $product.minimal_quantity == 1 AND $product.customizable != 2 AND !$PS_CATALOG_MODE} {if ($product.quantity > 0 OR $product.allow_oosp)} <a class="exclusive ajax_add_to_cart_button" rel="ajax_id_product_{$product.id_product}" href="{$link->getPageLink('cart')}?qty=1&id_product={$product.id_product}&token={$static_token}&add" title="{l s='Add to cart' mod='homefeatured'}">{l s='Add to cart' mod='homefeatured'}</a> {else} <span class="exclusive">{l s='Add to cart' mod='homefeatured'}</span> {/if} {else} {/if} <a class="button" href="{$product.link}" title="{l s='View' mod='homefeatured'}"><span>{l s='View' mod='homefeatured'}</span></a> </div> </li> {/foreach} </ul> </div> {else} <p>{l s='No featured products' mod='homefeatured'}</p> {/if} </div> <!-- /MODULE Home Featured Products --> Pour information, il n'y a pas de dossier ni de fichier homefeatured dans mon nouveau thème. Merci beaucoup Edited March 20, 2013 by chantal.herman (see edit history) Link to comment Share on other sites More sharing options...
Bondaty and Co Posted March 18, 2013 Share Posted March 18, 2013 essayez de remplacer la ligne li par celle-ci: <li class="ajax_block_product {if $smarty.foreach.homeFeaturedProducts.first}first_item{elseif $smarty.foreach.homeFeaturedProducts.last}last_item{else}item{/if} {if $smarty.foreach.homeFeaturedProducts.iteration%$nbItemsPerLine == 0}last_item_of_line{elseif $smarty.foreach.homeFeaturedProducts.iteration%$nbItemsPerLine == 1} {/if} {if $smarty.foreach.homeFeaturedProducts.iteration > ($smarty.foreach.homeFeaturedProducts.total - $totModulo)}last_line{/if}"> Link to comment Share on other sites More sharing options...
chantal.herman Posted March 18, 2013 Author Share Posted March 18, 2013 Merci beaucoup pour votre réponse, je viens d'essayer mais cela ne change rien malheureusement. une autre idée peut être ? J'ai essayé de créer des dossiers homefeatured dans le mon thème etc.. mais rien n'a fait évoluer cette affichage Link to comment Share on other sites More sharing options...
jmalixe Posted March 18, 2013 Share Posted March 18, 2013 Bonjour, il faudrait récuperer aussi une partie du css avec au moins #featured_products ul li { float: left; } Link to comment Share on other sites More sharing options...
chantal.herman Posted March 18, 2013 Author Share Posted March 18, 2013 Voici mon .css je ne trouve pas la ligne dont vous me parlez. ul .li ? En tout cas merci beaucoup ! #featured-products_block_center li { margin-right:10px; padding:10px 0; width:126px; height:240px } #featured-products_block_center li.last_item_of_line {margin-right:0;} #featured-products_block_center .s_title_block, #featured-products_block_center h5 { padding-top:5px; height:30px; font-size:12px; color:#222; padding-bottom: 0; font-weight:bold; } #featured-products_block_center .product_image { display:block; position:relative; overflow:hidden } #featured-products_block_center .product_image span.new { display: block; position: absolute; top: 15px; right:-30px; padding: 1px 4px; width: 101px; font-size:10px; color: #fff; text-align: center; text-transform: uppercase; -moz-transform: rotate(45deg); -webkit-transform: rotate(45deg); -o-transform:rotate(45deg); /*-ms-transform: rotate(45deg);*/ background-color: #990000; transform: rotate(45deg); /* Newer browsers */ filter: progid:DXImageTransform.Microsoft.Matrix(sizingMethod='auto expand', M11=0.7071067811865476, M12=-0.7071067811865475, M21=0.7071067811865475, M22=0.7071067811865476); /* IE6,IE7 */ -ms-filter: "progid:DXImageTransform.Microsoft.Matrix(SizingMethod='auto expand', M11=0.7071067811865476, M12=-0.7071067811865475, M21=0.7071067811865475, M22=0.7071067811865476)"; /* IE8 */ } .ie9 #featured-products_block_center .product_image span.new{top:-18px;right:-38px} .ie8 #featured-products_block_center .product_image span.new{top:-21px;right:-38px} .lt-ie6 #featured-products_block_center .product_image span.new {top:-30px;right:-25px} #featured-products_block_center .product_desc {height:45px;} #featured-products_block_center .product_desc, #featured-products_block_center .product_desc a { color:#666 } #featured-products_block_center .lnk_more { display:inline; padding-right:10px; font-weight:bold; font-size:10px; color:#0088cc; background:url(img/arrow_right_1.png) no-repeat 100% 3px; } #featured-products_block_center .price_container { margin-top:10px; padding:0; } #featured-products_block_center .price { font-weight:bold; font-size:14px; color:#990000 } #featured-products_block_center li .ajax_add_to_cart_button {display:none;} #featured-products_block_center li span.exclusive {display:none;} Link to comment Share on other sites More sharing options...
jmalixe Posted March 18, 2013 Share Posted March 18, 2013 tel quel, le css n'est pas pris en compte parce que dans le .tpl, on trouve <div id="featured_products"> et dans le css #featured-products_block_center Link to comment Share on other sites More sharing options...
chantal.herman Posted March 18, 2013 Author Share Posted March 18, 2013 D'accord je crois que je comprends. Que dois-je faire ? Enlever une ligne sur le tpl ? ou le css ? Pouvez vous m'indiquer la marche à suivre ? Merci beaucoup Link to comment Share on other sites More sharing options...
jmalixe Posted March 18, 2013 Share Posted March 18, 2013 je viens de regarder dans le css, le mieux est de changer dans le tpl et mettre <div id="featured-products_block_center"> à la place de <div id="featured_products"> Link to comment Share on other sites More sharing options...
chantal.herman Posted March 18, 2013 Author Share Posted March 18, 2013 Ok super je vois une évolution, les produits sont placés à gauche.. mais ne sont pas mis à la suite... étrange. Link to comment Share on other sites More sharing options...
jmalixe Posted March 18, 2013 Share Posted March 18, 2013 (edited) maintenant, il faut changer ça #featured-products_block_center li { height: 240px; margin-right: 10px; padding: 10px 0; width: 126px; } par ça #featured-products_block_center li { float: left; margin-right: 10px; padding: 10px 0; } Edited March 18, 2013 by jmalixe (see edit history) Link to comment Share on other sites More sharing options...
chantal.herman Posted March 18, 2013 Author Share Posted March 18, 2013 Super ça marche vraiment niquel. Par contre j'ai l'impression d'avoir perdu mon footer... Et j'ai vérifié les modules mais je n'ai rien touché. Merci beaucoup déjà Link to comment Share on other sites More sharing options...
Recommended Posts