Redundant Posted July 21, 2008 Share Posted July 21, 2008 hey folks, I am trying to obtain the product price, Only. In the products.tpl the price is displayed with lines such as these: {if $product.pricing.monthly}{$product.pricing.monthly}<br />{/if} But, {product.pricing.monthly} doesn't output only the price. The term is appended to the price. For example: "Price per month - $19.95" I've hunted through the Smarty documentation to figure out a way to extract the price, but wasn't successful. Anyone know of a WHMCS variable, or way I can get only the product price out of a string? Thanks in advance 0 Quote Link to comment Share on other sites More sharing options...
mobile Posted August 11, 2008 Share Posted August 11, 2008 Hi, I have the same issue. Anyone knows how to get the price only? Thanks 0 Quote Link to comment Share on other sites More sharing options...
brianr Posted August 11, 2008 Share Posted August 11, 2008 You can throw a {debug} tag in the .tpl file and view the page. It'll pop up a window that has all the variables you can use in the template. (If you have a busy site you'll want to remove the {debug} tag as soon as you view the page so your visitors can't see it. 0 Quote Link to comment Share on other sites More sharing options...
mobile Posted August 11, 2008 Share Posted August 11, 2008 Thanks for the great tip brianr . Unfortunately, the variables shown there include the term appended to the price as well. This brings me to a second question. Where can I find the variables that are available for editing. There are some variables that are too long for my template and sometimes the same variable is used in different templates as well as it would be a time saver to edit the one file than open each .tpl template. 0 Quote Link to comment Share on other sites More sharing options...
brianr Posted August 11, 2008 Share Posted August 11, 2008 Are you talking about the {$LANG.variable} ones? Those will be in the language definition file, check the /whmcs/lang/ directory. 0 Quote Link to comment Share on other sites More sharing options...
othellotech Posted August 11, 2008 Share Posted August 11, 2008 use the smarty rewrite option to remove the word "monthly" ? 0 Quote Link to comment Share on other sites More sharing options...
MikeDVB Posted August 13, 2008 Share Posted August 13, 2008 You could probably use a bit of PHP on the smarty variable to extract only the price. Maybe somebody can throw some code together for you to do this. I'll work on it, but I'm not very good with PHP yet 0 Quote Link to comment Share on other sites More sharing options...
mobile Posted August 13, 2008 Share Posted August 13, 2008 Those will be in the language definition file, check the /whmcs/lang/ directory. Actually the issue was resolved by editing the file in the whmcs/lang directory which was able to remove the Monthly, Quarterly, etc. Thanks all for the help. 0 Quote Link to comment Share on other sites More sharing options...
Redundant Posted August 13, 2008 Author Share Posted August 13, 2008 Hey Mobile, Just a heads up to be careful with that "work around". I tried that and later found that removing those via Lang Files resulted in some drop downs in Config Options, Addons, and other cart areas became unclear. In other words, some other parts of the cart are dependant on that term being part of the price in order to place the product option into context as far as payment term. 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.