hogava Posted June 2, 2019 Share Posted June 2, 2019 (edited) Hi, how i can show element for some product groups? now i use product id for if function (in viewcart.tpl & configureproduct.tpl),how is about product groups? {$showhello = 0} {if $product.pid == '1'} {$showhello = 1} {/if} {if $product.pid == '2'} {$showhello = 1} {/if} {if $product.pid == '3'} {$showhello = 1} {/if} {if $product.pid == '4'} {$showhello = 1} {/if} {if $showhello == 1} <p>Hello!</p> {/if} Edited June 2, 2019 by hogava 0 Quote Link to comment Share on other sites More sharing options...
Kian Posted June 2, 2019 Share Posted June 2, 2019 At the moment I can't see any tpl file (mobile phone) but instead of using multiple ifs you could use in_array statement like follows: {if $product.pid|in_array:['1','2','3','4']}{/if} 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted June 3, 2019 Share Posted June 3, 2019 On 02/06/2019 at 12:15, hogava said: now i use product id for if function (in viewcart.tpl & configureproduct.tpl),how is about product groups? add {debug} to the end of either template and you'll get a popup window of available variables. from memory, I think in viewcart, it would be {$product.productinfo.gid} (if you're in the products loop); configureproduct I can't recall off-hand, though there are some cart pages where you don't get access to a product group ID value, only the product group name - but you should be able to figure out the correct variable from the popup window... don't forget to remove {debug} from the template(s0 when you've finished. 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.