Manu-41 Posted November 23 Share Posted November 23 (edited) Bonjour, je cherche à avoir une condition d'affichage sur la page produit selon si l'id est pairs ou impairs. Je ne trouve pas d'infos sur le forum ;-( Merci pour votre aide Edited December 5 by Manu-41 M (see edit history) Link to comment Share on other sites More sharing options...
Prestashop Addict Posted November 23 Share Posted November 23 en php ou smarty ? Link to comment Share on other sites More sharing options...
Manu-41 Posted November 23 Author Share Posted November 23 Bonjour, en smarty Link to comment Share on other sites More sharing options...
Eolia Posted November 23 Share Posted November 23 Regardez le fonctionnement de l'opérateur modulo (%) Link to comment Share on other sites More sharing options...
Prestashop Addict Posted November 23 Share Posted November 23 (edited) {if $mavariable is even} Edited November 23 by Prestashop Addict (see edit history) Link to comment Share on other sites More sharing options...
doekia Posted November 23 Share Posted November 23 {if $product->id%2} 2 Link to comment Share on other sites More sharing options...
Manu-41 Posted November 24 Author Share Posted November 24 Super, merci ! 19 hours ago, doekia said: {if $product->id%2} Link to comment Share on other sites More sharing options...
Manu-41 Posted December 4 Author Share Posted December 4 Je reviens sur ce sujet, pour un complément. Est-il possible de combiner la variable {if $product->id%2} c'est paire {else} c'est impaire {/if} en ajoutant la catégorie par default pair/impaire pour avoir plus de conditions (cela pourrait en faire 4 normalement) ? {$product->id_category_default} Merci pour votre aide 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