Jump to content

Code to display a percentage of current product price in template?


Recommended Posts

I would like to display a custom dollar amount in my product list tpl that will multiply the current product price by a set percentage (decimal) like $2.25 x .20 = $0.45. So the $0.45 would display where I had put the code in the tpl file. Does anyone know the best way to make this work?

 

This is for 1.4.7.3

 

Thanks!

Edited by AFemaleProdigy (see edit history)

Share this post


Link to post
Share on other sites

This should do it.

 

{convertPrice price=$productPrice*.20}

 

that will work for the price on the product page, if it is not in a combo or doesn't have a price drop.

Share this post


Link to post
Share on other sites

Never mind. Figured it out...

 

{if isset($product.show_price) && $product.show_price && !isset($restricted_country_mode)}<span class="price" style="display: inline;">{if !$priceDisplay}{convertPrice price=$product.price*.30}{else}{convertPrice price=$product.price_tax_exc*.30}{/if}</span><br />{/if}

 

Thanks, DH!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More