stuntnmore Posted July 12, 2014 Share Posted July 12, 2014 Hello Im trying to do this {if $configoption.optionname eq "Bandwidth" && $configoption.optionname eq "Extra IP Address"} I want it if it equals either value to output whatever is in the code. currently this works {if $configoption.optionname eq "Bandwidth"} Your code {/if} But i need it to be equal to multiple things, and if its not equal to one of them but the other value is to still show the code. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted July 12, 2014 Share Posted July 12, 2014 if you only want something to be done when (at least) one of them is true, why use && (and)? shouldn't you be using OR instead? {if $configoption.optionname eq "Bandwidth" or $configoption.optionname eq "Extra IP Address"} {if $configoption.optionname eq "Bandwidth" || $configoption.optionname eq "Extra IP Address"} 0 Quote Link to comment Share on other sites More sharing options...
sentq Posted July 12, 2014 Share Posted July 12, 2014 also, if that what you need {if $configoption.optionname eq "Bandwidth"} {$configoption.optionname} {elseif $configoption.optionname eq "Extra IP Address"} {$configoption.optionname} {/if} 0 Quote Link to comment Share on other sites More sharing options...
stuntnmore Posted July 13, 2014 Author Share Posted July 13, 2014 It makes it have two of the same code, i want it to show once only. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted July 13, 2014 Share Posted July 13, 2014 perhaps you need to set a flag so that if bandwidth exists, it doesn't reprint the heading for the second time... it's difficult to give specifics as you're using a custom nhp template and I assume you're modifying it now as it's no longer working, but i'm thinking of something along the lines of setting a flag (assign a variable as true) in the {if} statement for bandwidth... but before that, putting an {if} statement around the heading that checks if the above variable is false (or doesn't exist) and prints the heading (by implication if true, it won't print the heading).. you'd also have to remember to unset the flag. 0 Quote Link to comment Share on other sites More sharing options...
stuntnmore Posted July 13, 2014 Author Share Posted July 13, 2014 Could you give an example? 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted July 13, 2014 Share Posted July 13, 2014 I could, but it might be easier to see the {if $configurableoptions} block of code from your configureproduct.tpl nhpcart template - PM it to me if you don't want to post it publicly. i'm wondering if the terms "Server Configuration", "Network Firewall Configuration" etc are the names of Configuration Option Groups?? if so, then as I don't think the standard order form templates use them, any code I post based on them might be irrelevant for your needs. 0 Quote Link to comment Share on other sites More sharing options...
stuntnmore Posted July 14, 2014 Author Share Posted July 14, 2014 Its within the template cart, not the groups. 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.