mihai666g Posted February 8, 2015 Share Posted February 8, 2015 Hi, I want to do some customization on configureproduct.tpl based on the product id that the client is trying to order. I think the code should be something like this: {if $product.id eq "123"} good {/if} ...but is not working. Any idea how can I make this to work ? 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted February 8, 2015 Share Posted February 8, 2015 try $product.pid - but if all else fails, add {debug} to your template code and it will popup a window showing the Smarty variables/arrays available. 0 Quote Link to comment Share on other sites More sharing options...
mihai666g Posted February 9, 2015 Author Share Posted February 9, 2015 try $product.pid - but if all else fails, add {debug} to your template code and it will popup a window showing the Smarty variables/arrays available. Thanks. {debug} option helped me to find the right syntax, witch is: {if $productinfo.pid eq "123"} good {/if} 0 Quote Link to comment Share on other sites More sharing options...
Businezz Posted September 2, 2021 Share Posted September 2, 2021 On 2/8/2015 at 4:38 PM, brian! said: try $product.pid - but if all else fails, add {debug} to your template code and it will popup a window showing the Smarty variables/arrays available. How can i use on multiple products? Will it work: {if $productinfo.pid eq "1,2,3"} good {/if} Thanks! 0 Quote Link to comment Share on other sites More sharing options...
pRieStaKos Posted September 2, 2021 Share Posted September 2, 2021 (edited) 4 hours ago, Businezz said: How can i use on multiple products? Will it work: {if $productinfo.pid eq "1,2,3"} good {/if} Thanks! {if $productinfo.pid|in_array:[1,2,3]} Edited September 2, 2021 by pRieStaKos 1 Quote Link to comment Share on other sites More sharing options...
Businezz Posted September 2, 2021 Share Posted September 2, 2021 6 hours ago, pRieStaKos said: {if $productinfo.pid|in_array:[1,2,3]} Worked! Thanks! 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.