Jump to content

showing the annual price


rachoudz

Recommended Posts

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>

 

Link to comment
Share on other sites

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) ??

Link to comment
Share on other sites

 
 
 
🤓
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.

Link to comment
Share on other sites

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!

Link to comment
Share on other sites

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

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