Jump to content

Display one time amount at checkout?


robetus

Recommended Posts

Is possible to display the one time amount separately like you can with recurring amounts? How can I show the one time amount with the following (obviously what I wrote isn't working):

                                <div class="recurring-totals clearfix">
                                    <span class="pull-left">{$LANG.orderForm.totals}</span>
                                    <span id="recurring" class="pull-right recurring-charges">
                                        <span id="recurringMonthly" {if !$totalrecurringmonthly}style="display:none;"{/if}>
                                            <span class="cost">{$totalrecurringmonthly}</span> {$LANG.orderpaymenttermmonthly}<br />
                                        </span>
                                        <span id="recurringQuarterly" {if !$totalrecurringquarterly}style="display:none;"{/if}>
                                            <span class="cost">{$totalrecurringquarterly}</span> {$LANG.orderpaymenttermquarterly}<br />
                                        </span>
                                        <span id="recurringSemiAnnually" {if !$totalrecurringsemiannually}style="display:none;"{/if}>
                                            <span class="cost">{$totalrecurringsemiannually}</span> {$LANG.orderpaymenttermsemiannually}<br />
                                        </span>
                                        <span id="recurringAnnually" {if !$totalrecurringannually}style="display:none;"{/if}>
                                            <span class="cost">{$totalrecurringannually}</span> {$LANG.orderpaymenttermannually}<br />
                                        </span>
                                        <span id="recurringBiennially" {if !$totalrecurringbiennially}style="display:none;"{/if}>
                                            <span class="cost">{$totalrecurringbiennially}</span> {$LANG.orderpaymenttermbiennially}<br />
                                        </span>
                                        <span id="recurringTriennially" {if !$totalrecurringtriennially}style="display:none;"{/if}>
                                            <span class="cost">{$totalrecurringtriennially}</span> {$LANG.orderpaymenttermtriennially}<br />
                                        </span>
                                        <span id="onetime" {if !$totalonetime}style="display:none;"{/if}>
                                            <span class="cost">{$totalonetime}</span> {$LANG.orderpaymenttermonetime}<br />
                                        </span>
                                    </span>
                                </div>

 

Link to comment
Share on other sites

7 hours ago, robetus said:

Is possible to display the one time amount separately like you can with recurring amounts? How can I show the one time amount with the following (obviously what I wrote isn't working):

short answer is no - the variable you're looking for (whatever it's called!) doesn't exist...

long answer is that you could *probably* calculate it in the template from other existing variables/arrays if you *had* to, but it wouldn't be straightforward.

Link to comment
Share on other sites

Okay, I'm not to sure why a totalonetime wasn't programmed though. It seems like it should be there. The One Time fee items aren't even listed at in the summary at checkout with the standard cart and I'm not sure why WHMCS would leave something like that out. You have two possible pricing types recurring or one-time, free is free there is no price. Why would they create separate totals for all the recurring cycles and not one for one time products, makes no sense.

I had to resort to hiding the listing completely when one time with smarty.

Link to comment
Share on other sites

There is a one-time cost and you should be able to show it at checkout, that makes sense. Customers have to pay something at checkout so that should be shown, don't you think? I think recurring should be shown too, don't get me wrong, both should be shown.

Link to comment
Share on other sites

18 minutes ago, robetus said:

There is a one-time cost and you should be able to show it at checkout, that makes sense.

sometimes it's best to abandon any hope of WHMCS 'making sense'... :P

20 minutes ago, robetus said:

Customers have to pay something at checkout so that should be shown, don't you think? I think recurring should be shown too, don't get me wrong, both should be shown.

i'm not necessarily disagreeing with you.. it's just the way things have always been (from memory) with the cart.

I might have a closer look at this at the weekend... the info is there, but hidden deeply and it might be interesting to see if it can be extracted correctly.

Link to comment
Share on other sites

15 hours ago, robetus said:

That would be awesome, thank you!

so one quick way to do it would be to add the following inside the {foreach $products as $num => $product} loop in standard_cart/viewcart.tpl...

{if $product.productinfo.name eq "One-Time"}
	{assign totalonetime $totalonetime + $product.pricing.totaltoday->toNumeric()}
{/if}

that will give you a running total for one-time products, which you can then output in a similar way to your previous code...

<span id="onetime" {if !$totalonetime}style="display:none;"{/if}>
	<span class="cost">{$currency.prefix}{$totalonetime|string_format:"%.2f"}{$currency.suffix}</span> {$LANG.orderpaymenttermonetime}<br />
</span>

FkUaBfi.png

as it's currently written, it includes setup fees in the one-time amounts, but you could remove them by using $product.pricing.baseprice instead of $product.pricing.totaltoday, or $product.pricing.setup if you wanted a running total of just one-time setup fees. :idea:

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