Lacroix Posted October 18, 2016 Share Posted October 18, 2016 Bonjour, Je suis sur Prestashop 1.6.1.6 et j'ai créer ce code dans la page produit : <div id="mention"/> <li class="icon-check icon-2x">En stock</li> </div> Ce qui affiche en stock sur toutes mes pages produits. J'aimerai cependant que cette règle soit exclus pour 2 produits. Je cherche un moyen de faire un code pouvant attribuer cette mention sauf certains produits, par rapport à leur ID. Quelqu'un peut m'aider? Je vous remercie d'avance !! Link to comment Share on other sites More sharing options...
coeos.pro Posted October 18, 2016 Share Posted October 18, 2016 essayez avec : {if $product->id neq 123 AND $product->id neq 456} <div id="mention"/> <li class="icon-check icon-2x">En stock</li> </div> {/if} en changeant 123 et 456 par les id_product Link to comment Share on other sites More sharing options...
Lacroix Posted October 18, 2016 Author Share Posted October 18, 2016 Un TOUT GRAND MERCI !! Cela marche et c'est grâce à vous. Merci merci merci Link to comment Share on other sites More sharing options...
doekia Posted October 18, 2016 Share Posted October 18, 2016 {if !in_array($product->id,array(123,456,789))} <ton html /> {/if} Link to comment Share on other sites More sharing options...
Lacroix Posted November 18, 2016 Author Share Posted November 18, 2016 (edited) Bonjour, Si je voulais faire l'inverse maintenant. Afficher un HTML uniquement pour quelques produits? Actuellement, j'ai : {if $product->id == 775 && $product->id == 773 } Mais il ne prend pas en compte l'id 773. Merci de vos lumières Edited November 18, 2016 by Lacroix (see edit history) Link to comment Share on other sites More sharing options...
coeos.pro Posted November 18, 2016 Share Posted November 18, 2016 il ne faut pas mettre && mais || Link to comment Share on other sites More sharing options...
Lacroix Posted November 18, 2016 Author Share Posted November 18, 2016 Super !!! Un tout grand merci pour votre rapidité. Je moulinais depuis 10 min :) 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