Vinosensis Posted March 22, 2011 Share Posted March 22, 2011 Dans product.tpl, je voudrais montrer une image si le produit est dans la categorie C.Pour l'instant j'ai le code suivant: {if $category->id == C_id } <!-- Display category logo --> {/if} version: 1.4.0.17 Link to comment Share on other sites More sharing options...
jherbaux Posted March 23, 2011 Share Posted March 23, 2011 et ? Sa ne marche pas ?si sa ne marche pas fait {$category->id} == {C_id} tu verras :Si tu as les 2 valeurs existanteSi elle son égalsi l'une d'entre elle n'existe pas tu peux faire un {debug} dans ton code ( en espérant que sa marche toujours dans la 1.4)Tu verras les variables disponibles Link to comment Share on other sites More sharing options...
coeos.pro Posted March 23, 2011 Share Posted March 23, 2011 Bonjour, il faut 2= en php mais en smarty c'est 1 seul : {if $category->id = C_id } et C_id c'est quoi ? => $C_id ou alors 'C_id' Link to comment Share on other sites More sharing options...
Vinosensis Posted March 23, 2011 Author Share Posted March 23, 2011 Merci pour votre aide.Mon code fonctionne uniquement lorsque j'ouvre la page produit (product.tpl) sous une categorie; si j'ouvre la page directement, le code ne fonctionne plus.Exemple 1: La page est "sous" la categorie en question et l'image Parker est montréehttp://vinosensis.com/es/232-mo-salinas-2009.htmlExemple 2: La page est ouverte directement, l'image parker ne se montre pas.http://vinosensis.com/es/232-mo-salinas-2009.html 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