rachoudz Posted February 18, 2020 Share Posted February 18, 2020 Hello, I'm working on a customized template, and I want to show the annual price for my products, which they have only Annually price. I don't need to see the breakdown price. Your help would be appreciated! Here is the products.tpl <div id="products" class="price-table-container"> <ul class="row"> {foreach $products as $product} <li class="col-sm-12 col-md-4 col-lg-4" id="product{$product@iteration}"> <div class="price-table"> <div class="top-head"> {if $product.tagLine} <p id="product{$product@iteration}-tag-line">{$product.tagLine}</p> {/if} {if $product.isFeatured} <div class="popular-plan"> {$LANG.featuredProduct|upper} </div> {/if} <div class="price-area"> <div class="top-area"> <h4 id="product{$product@iteration}-name">{$product.name}</h4> </div> <div class="price" id="product{$product@iteration}-price"> {if $product.bid} {$LANG.bundledeal} {if $product.displayprice} <br /><br /><span>{$product.displayPriceSimple}</span> {/if} {elseif $product.paytype eq "free"} {$LANG.orderfree} {elseif $product.paytype eq "onetime"} {$product.pricing.onetime} {$LANG.orderpaymenttermonetime} {else} {if $product.pricing.hasconfigoptions} {$LANG.from} {/if} {$product.pricing.minprice.cycleText} <br> 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted February 21, 2020 Share Posted February 21, 2020 On 18/02/2020 at 08:39, rachoudz said: I'm working on a customized template, and I want to show the annual price for my products, which they have only Annually price. I don't need to see the breakdown price. WHMCS automatically sets the smallest cycle as the minprice cycle, so if you had a product that was only priced Annually, then the products page should show the annual price by default without any template changes. if you had a product priced monthly and annually, then it would show the monthly price.. are you saying that you always want to show the annual price (assuming the current product is priced annually) ?? 1 Quote Link to comment Share on other sites More sharing options...
rachoudz Posted February 21, 2020 Author Share Posted February 21, 2020 2 6 minutes ago, brian! said: WHMCS automatically sets the smallest cycle as the minprice cycle, so if you had a product that was only priced Annually, then the products page should show the annual price by default without any template changes. if you had a product priced monthly and annually, then it would show the monthly price.. are you saying that you always want to show the annual price (assuming the current product is priced annually) ?? Thank you for your response, but it shows the breakdown monthly price even if I have only an annual price of this group of products. 0 Quote Link to comment Share on other sites More sharing options...
rachoudz Posted February 21, 2020 Author Share Posted February 21, 2020 13 minutes ago, brian! said: are you saying that you always want to show the annual price (assuming the current product is priced annually) ?? I want to show the annual price only for the group of the annual price products. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted February 24, 2020 Share Posted February 24, 2020 On 21/02/2020 at 16:45, rachoudz said: Thank you for your response, but it shows the breakdown monthly price even if I have only an annual price of this group of products. then I assume you have monthly pricing breakdown enabled (MPB) in general settings -> ordering ?? if so, unticking that box, is by far the easiest way to solve the issue. 🙂 https://docs.whmcs.com/Ordering_Tab#Monthly_Pricing_Breakdown the problem you have is that with MPB enabled, then nearly all the pricing variables are adjusted to use it (which is reasonable enough!), e.g., I assume that you're using {$product.pricing.minprice.price} to show the recurring price. if you wanted to keep MPB enabled, then you're either looking at a CAPC hook to manipulate the pricing array to give it non-MPB pricing, or you use alternate variables in the template, for example... {$currency.prefix}{$product.pricing.rawpricing.annually}{$currency.suffix) ... would show an annual price regardless of whether MPB was enabled or not. sadly, with MPB enabled, the shown cycle will likely always be "Monthly", which is not ideal if you want to show annual pricing - but all these things can be worked around if required... though let's find out whether disabling MPB is an option first! 1 Quote Link to comment Share on other sites More sharing options...
rachoudz Posted February 24, 2020 Author Share Posted February 24, 2020 4 hours ago, brian! said: then I assume you have monthly pricing breakdown enabled (MPB) in general settings -> ordering ?? if so, unticking that box, is by far the easiest way to solve the issue. 🙂 https://docs.whmcs.com/Ordering_Tab#Monthly_Pricing_Breakdown the problem you have is that with MPB enabled, then nearly all the pricing variables are adjusted to use it (which is reasonable enough!), e.g., I assume that you're using {$product.pricing.minprice.price} to show the recurring price. if you wanted to keep MPB enabled, then you're either looking at a CAPC hook to manipulate the pricing array to give it non-MPB pricing, or you use alternate variables in the template, for example... {$currency.prefix}{$product.pricing.rawpricing.annually}{$currency.suffix) ... would show an annual price regardless of whether MPB was enabled or not. sadly, with MPB enabled, the shown cycle will likely always be "Monthly", which is not ideal if you want to show annual pricing - but all these things can be worked around if required... though let's find out whether disabling MPB is an option first! Thank you!! it fixed my problem 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.