Synertic Posted May 29, 2017 Share Posted May 29, 2017 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 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted May 29, 2017 Share Posted May 29, 2017 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. 0 Quote Link to comment Share on other sites More sharing options...
Synertic Posted May 29, 2017 Author Share Posted May 29, 2017 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 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted June 2, 2017 Share Posted June 2, 2017 it is possible to do that? exemple on siteground https://www.siteground.com/web-hosting.htm it's possible... I suspect slightly easier is Monthly Pricing breakdown is disabled, or you're going to hardcode it to use a monthly price as the baseline. 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.