Jump to content

[RESOLU]Modification product-list.tpl et stocks


Recommended Posts

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)
image.thumb.png.59cfc983b465c00a2d1c747fa3379257.png

 

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 : 
image.thumb.png.bc87bf52fb6f9ce949b537bc7127eb7d.png

 

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? 

 

 

image.png

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

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 by syl2042 (see edit history)
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...