syl2042 Posted December 4, 2017 Share Posted December 4, 2017 (edited) Bonjour, J'ai un souci de présentation de ma liste produits. J'ai construit ma liste ainsi (avec encore quelques réglages à prévoir, mais faciles) Mais ici, je ne gère pas les stocks. Dès que j'active la gestion de stocks, l'affichage est parti en live avec les textes "out of stock" et "in stock". J'ai supprimé ces mentions qui ne m'intéressent pas. En fait, je vais avoir un bouton "+" pour ajouter au panier en vert quand e produit est en stock, et un bouton "+" en rouge, lorsque le produit ne sera pas en stock. Je n'ai aucune difficulté pour mettre ceci en place. Par contre, mon problème est celui-ci : Lorsque mes produits sont en stock, il n'y a pas de souci. Mais dès que la liste rencontre le premier produit sans stock, alors l'affichage devient n'importe quoi. Voici exemple : Mes 3 premiers produits ont du stock pas de souci. Mon quatrième produit n'a aucun stock, et l'affichage est correct avec un bouton "+" opacifié et sans lien. Mais à partir du cinquième produit (qu'il soit en stock ou pas), cela part en live. Et le reste des produits se retrouvent également en vrac tout en bas du site. Je pense que le problème se situe au niveau de ce bout de code : <li class=" wow slideInUp ajax_block_product{if $page_name == 'index' || $page_name == 'product'} col-xs-6 col-sm-4 col-md-3{else} col-xs-6 col-sm-6 col-md-4{/if}{if $smarty.foreach.products.iteration%$nbItemsPerLine == 0} last-in-line{elseif $smarty.foreach.products.iteration%$nbItemsPerLine == 1} first-in-line{/if}{if $smarty.foreach.products.iteration > ($smarty.foreach.products.total - $totModulo)} last-line{/if}{if $smarty.foreach.products.iteration%$nbItemsPerLineTablet == 0} last-item-of-tablet-line{elseif $smarty.foreach.products.iteration%$nbItemsPerLineTablet == 1} first-item-of-tablet-line{/if}{if $smarty.foreach.products.iteration%$nbItemsPerLineMobile == 0} last-item-of-mobile-line{elseif $smarty.foreach.products.iteration%$nbItemsPerLineMobile == 1} first-item-of-mobile-line{/if}{if $smarty.foreach.products.iteration > ($smarty.foreach.products.total - $totModuloMobile)} last-mobile-line{/if}"> Mais je ne trouve pas le souci. Auriez vous une piste? Edited December 4, 2017 by syl2042 (see edit history) Link to comment Share on other sites More sharing options...
syl2042 Posted December 4, 2017 Author Share Posted December 4, 2017 (edited) pour ceux que cela intéresse, j'ai trouvé la solution. sur ce code : <li class=" wow slideInUp ajax_block_product{if $page_name == 'index' || $page_name == 'product'} col-xs-6 col-sm-4 col-md-3{else} col-xs-6 col-sm-6 col-md-4{/if}{if $smarty.foreach.products.iteration%$nbItemsPerLine == 0} last-in-line{elseif $smarty.foreach.products.iteration%$nbItemsPerLine == 1} first-in-line{/if}{if $smarty.foreach.products.iteration > ($smarty.foreach.products.total - $totModulo)} last-line{/if}{if $smarty.foreach.products.iteration%$nbItemsPerLineTablet == 0} last-item-of-tablet-line{elseif $smarty.foreach.products.iteration%$nbItemsPerLineTablet == 1} first-item-of-tablet-line{/if}{if $smarty.foreach.products.iteration%$nbItemsPerLineMobile == 0} last-item-of-mobile-line{elseif $smarty.foreach.products.iteration%$nbItemsPerLineMobile == 1} first-item-of-mobile-line{/if}{if $smarty.foreach.products.iteration > ($smarty.foreach.products.total - $totModuloMobile)} last-mobile-line{/if}"> <div class="product-container" itemscope itemtype="https://schema.org/Product"> Il faut ajouter un div row apris le div product-container, ce qui donne : <li class=" wow slideInUp ajax_block_product{if $page_name == 'index' || $page_name == 'product'} col-xs-6 col-sm-4 col-md-3{else} col-xs-6 col-sm-6 col-md-4{/if}{if $smarty.foreach.products.iteration%$nbItemsPerLine == 0} last-in-line{elseif $smarty.foreach.products.iteration%$nbItemsPerLine == 1} first-in-line{/if}{if $smarty.foreach.products.iteration > ($smarty.foreach.products.total - $totModulo)} last-line{/if}{if $smarty.foreach.products.iteration%$nbItemsPerLineTablet == 0} last-item-of-tablet-line{elseif $smarty.foreach.products.iteration%$nbItemsPerLineTablet == 1} first-item-of-tablet-line{/if}{if $smarty.foreach.products.iteration%$nbItemsPerLineMobile == 0} last-item-of-mobile-line{elseif $smarty.foreach.products.iteration%$nbItemsPerLineMobile == 1} first-item-of-mobile-line{/if}{if $smarty.foreach.products.iteration > ($smarty.foreach.products.total - $totModuloMobile)} last-mobile-line{/if}"> <div class="product-container" itemscope itemtype="https://schema.org/Product"><div classe="row"> Voilou Edited December 4, 2017 by syl2042 (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now