Jump to content

Help with smarty variable


Recommended Posts

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.

Link to comment
Share on other sites

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"}

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated