-M- Posted November 5, 2015 Share Posted November 5, 2015 I thought I had this nailed, however the outcome is not what was to be expected. I have this piece of code: {if {$configoption.optionname} eq "500 accounts / 20000 MB (1000 GB)"} {$configoption.optionname|replace:'500 accounts / 20000 MB (1000 GB)':'500 / 20000 MB / 1000 GB'} {elseif {$configoption.optionname} eq "SpamAssassin & Kaspersky anti-virus"} {$configoption.optionname|replace:' anti-virus':''} {elseif {$configoption.optionname} eq "Full backup plan with several restores a year"} {$configoption.optionname|replace:' with several restores a year':''} {else} {$configoption.optionname} {/if} In the above code, it will only replace the first one, after that it outputs everything as normal (no further replacements). It should apply all replacements and put the rest of the (remaining) options out as they were entered. I am guessing I should use something else in here other than {if} and {elseif}, however I have no clue on what to use? Because if I re-read the above code, the first {if} is processed and then goes back to outputting the rest under {$configoption.optionname}, right? //added reason I am doing this, because the cart window is a bit to small, therefor I am shortening things in the cart section. I did try to resize the columns, but that made things look ugly / messy and therefor it's not an option. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted November 5, 2015 Share Posted November 5, 2015 you don't need the brackets around the variable in the {if} and {elseif} statements... {if $configoption.optionname eq "500 accounts / 20000 MB (1000 GB)"} {$configoption.optionname|replace:'500 accounts / 20000 MB (1000 GB)':'500 / 20000 MB / 1000 GB'} 0 Quote Link to comment Share on other sites More sharing options...
-M- Posted November 6, 2015 Author Share Posted November 6, 2015 (edited) Hi Brian, Well even without the brackets as you mention, it still stops after the first replace result and doesn't process the others. As an example: {if $configoption.optionname eq "500 accounts / 20000 MB (1000 GB)"} {$configoption.optionname|replace:'500 accounts / 20000 MB (1000 GB)':'500 / 20000 MB / 1000 GB'} {elseif $configoption.optionname eq "SpamAssassin & Kaspersky anti-virus"} {$configoption.optionname|replace:' anti-virus':''} {elseif $configoption.optionname eq "Full backup plan with several restores a year"} {$configoption.optionname|replace:' with several restores a year':''} {else} {$configoption.optionname} {/if} //small edit Can it be that the culprit is the '&' symbol? Because I checked the other replacements and they work, except for the 'SpamAssassin & Kaspersky anti-virus' one. The first and last replacement actually works, which I just noticed now. Edited November 6, 2015 by MvdL1979 0 Quote Link to comment Share on other sites More sharing options...
-M- Posted November 6, 2015 Author Share Posted November 6, 2015 Nevermind fixed it! It was indeed the '&'-symbol which was giving problems. Solved it by using: & instead. 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.