paperweight Posted September 17, 2011 Share Posted September 17, 2011 Hello, I want to display different text and links on my Client Area depending on the types of services a client has purchased. How is the best way to create an if/if/else statement in the manner such as: If productA, show textA If productB, show textB If productC, show textC If otherproducts or anything else, show textD Tks for your help~ 0 Quote Link to comment Share on other sites More sharing options...
scar45 Posted September 17, 2011 Share Posted September 17, 2011 (edited) +1 for this, more specifically, I am trying to edit the "configureproduct.tpl" template in my Cart theme directory to show certain text if the PID is equal to a certain value... ** UPDATE ** - Sort of figured this out. After looking into my WHMCS database via phpMyAdmin, I was able to set the conditional via: {if $productinfo.name eq "YOUR PRODUCT NAME AS IN THE DATABASE"}<h1>TESTING</h1>{/if} I was looking to do this via the product ID, however I couldn't quite figure that out. It would be great to have some sort of Wiki with all of the Smarty Template Variables that we can work with... Hope this helps, but if anyone has a better solution, please provide it! Edited September 17, 2011 by scar45 Sort of figured it out 0 Quote Link to comment Share on other sites More sharing options...
scar45 Posted September 17, 2011 Share Posted September 17, 2011 Here's another way to use conditionals to list the group name: {if $gid}{$groupname}{/if} I know this is probably rookie compared to what the WHMCS pros know, but I'm a noob at it, and trying to give some feedback whenever I can to help anyone else out Again, a complete listing somewhere of how these variables relate to their database counterparts would be great! (Did some searching, but couldn't find anything...) 0 Quote Link to comment Share on other sites More sharing options...
paperweight Posted September 18, 2011 Author Share Posted September 18, 2011 I was looking to do this via the product ID, however I couldn't quite figure that out. It would be great to have some sort of Wiki with all of the Smarty Template Variables that we can work with... Hope this helps, but if anyone has a better solution, please provide it! Wow, excellent! Yes, this product name a good place to start. I too would rather find a way to use the product ID, since my product names may change from time to time and we also are using multiple languages -- the better I can hardcode the ID into the template, the less I have to worry about changing multiple files in the future. I will take your advice and start searching for a product ID method and post it here if I find a solution. Many thanks for your hard work and I hope to repay with a solution soon. 0 Quote Link to comment Share on other sites More sharing options...
sparky Posted September 18, 2011 Share Posted September 18, 2011 {$id} should be available to use on the product template files 0 Quote Link to comment Share on other sites More sharing options...
paperweight Posted September 18, 2011 Author Share Posted September 18, 2011 cheers, I'll try that~ I'm aiming to add some small customizations to the client area homepage with that. 0 Quote Link to comment Share on other sites More sharing options...
paperweight Posted September 18, 2011 Author Share Posted September 18, 2011 Again, a complete listing somewhere of how these variables relate to their database counterparts would be great! (Did some searching, but couldn't find anything...) I found this on some threads: {debug} Add the above to any page and it will output a pop-up window when you load the page. That pop-up will contain a very long list of possible variables. I'm still uncertain though if that list is ALL the possibilities, or just the ones for those pages it is loaded on.... 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.