Jump to content

Show Annual, biennial and triennial price


Synertic

Recommended Posts

Hi, I add this string on my templates/orderforms/premium_comparison/products.tpl file to show those price instead of monthly price and the string dosn't work.

 

Does someone can see what I'm doing wrong?

 

 

{if $product.pricing.rawpricing.triennially neq -1}<span>{($product.pricing.rawpricing.triennially/36)|string_format:"%.2f"}</span>/mo{else}{$product.pricing.rawpricing.biennially neq -1}<span>{($product.pricing.rawpricing.biennially/24)|string_format:"%.2f"}</span>/mo{else}{$product.pricing.rawpricing.annually neq -1}<span>{($product.pricing.rawpricing.annually/12)|string_format:"%.2f"}</span>/mo{else}{$product.pricing.minprice.cycleText}{/if}

 

 

If I use only this string is working

 

{if $product.pricing.rawpricing.triennially neq -1}<span>{($product.pricing.rawpricing.triennially/36)|string_format:"%.2f"}</span>/mo{else}{$product.pricing.minprice.cycleText}{/if}

 

 

There is a way to put annual, biennal and triennial together on the string?

 

thanks

 

Eric

 

- - - Updated - - -

 

This replace the line 85 onthe file premium_comparison/products.tpl

Link to comment
Share on other sites

Eric,

 

your problem was they way you were using else - it should really be elseif and the correct code should be along the lines of...

 

{if $product.pricing.rawpricing.triennially neq -1}<span>{$currency.prefix}{($product.pricing.rawpricing.triennially/36)|string_format:"%.2f"}</span>/mo{elseif $product.pricing.rawpricing.biennially neq -1}<span>{$currency.prefix}{($product.pricing.rawpricing.biennially/24)|string_format:"%.2f"}</span>/mo{elseif $product.pricing.rawpricing.annually neq -1}<span>{$currency.prefix}{($product.pricing.rawpricing.annually/12)|string_format:"%.2f"}</span>/mo{else}{$product.pricing.minprice.cycleText}{/if}

i've added the currency prefix to the output, but you can remove that if it's not necessary - or replace with a suffix after the output if your currency uses that instead.

Link to comment
Share on other sites

Thank, the code works but It dosen't show the longest terme by default.

 

What I try to do is the show the starting price using the longest terme but showing the monthly cost

 

Like regular price 9.95$ monthy but 6.95$/month if 3 years supscibtion

 

Like:

 

Regula price 9.95 (base on monthly suscribtion

Sale price 6.95 base mon 36 month terms

 

 

it is possible to do that? exemple on siteground https://www.siteground.com/web-hosting.htm

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