Jump to content

Product Price in Products.TPL


Redundant

Recommended Posts

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

Link to comment
Share on other sites

  • 3 weeks later...

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

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