Jump to content

Show explanation for prorata on order form


inteldigital

Recommended Posts

I searched the web and could not find any solution to this, I have no knowledge of WHMCS coding either. I'm trying to find out how to show that an item is prorata on the order form, since the total price to pay today is never correct (because of prorata) and there are no notifications to explain why it's not adding up, customers are abandoning their cart because of it.

 

How can I resolve this? Please help. Thank you.

Link to comment
Share on other sites

41 minutes ago, brian! said:

perhaps the thread below will help - it's a simple hook to determine if a product is prorata, and if so, you can add an additional line of code to the configureproduct.tpl template to say that it is (or in your case, give an explanation).

 

Thanks Brian, this looks helpful. Where would I place this? I am hoping to show a message on the view cart page. I have no clue with WHMCS, sorry. How would I also work out how much is prorata'd to show it?

 

Thanks, Brian.

Link to comment
Share on other sites

15 hours ago, inteldigital said:

Thanks Brian, this looks helpful. Where would I place this? I am hoping to show a message on the view cart page. I have no clue with WHMCS, sorry. How would I also work out how much is prorata'd to show it?

if you're wanting to do it in viewcart, then all the variables should already be available and you won't need any hook. :idea:

so for a pro-rata product, it should show something similar to below in viewcart...

Screenshot_31.png

and in /templates/orderforms/standard_cart/viewcart.tpl, the code already there (~line 140) for that is...

{if $product.proratadate}<br />({$LANG.orderprorata} {$product.proratadate}){/if}

if you change that code to the following...

{if $product.proratadate}<br />({$LANG.orderprorata} {$product.proratadate})<br />
{$product.pricing.recurringexcltax.{$product.billingcyclefriendly}} {$product.billingcyclefriendly}<br />
{$product.pricing.recurring.{$product.billingcyclefriendly}} {$product.billingcyclefriendly}{/if}

so this is a £10GBP monthly product and i've added two lines - the first in the recurring price (should include any configurable options too) without tax, the second line is the recurring price including tax.

now you won't necessarily need to include both lines, so if you only intend to use one, it's probably best to choose the last line that includes VAT - if the product isn't taxed, then this second line amount will equal the first line anyway.

eYFYLgZ.png

 

with regards to adding a message, you could either add something within that {if} statement, either hardcoded or using Language Overrides, or because you are likely pushed for space, perhaps use a bootstrap tooltip to display information when the mouse is over a particular character (e.g a ? icon).

n5_VA1_OS9_Sqq_GKyd3u_Zy_Zx_A.png

{if $product.proratadate}<br />({$LANG.orderprorata} {$product.proratadate}) <a href="#" data-toggle="tooltip" data-placement="left" title="Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."><i class="fa fa-question-circle"></i></a><br />
{$product.pricing.recurringexcltax.{$product.billingcyclefriendly}} {$product.billingcyclefriendly}<br />
{$product.pricing.recurring.{$product.billingcyclefriendly}} {$product.billingcyclefriendly}{/if}

if you wanted to, you can even tweak the css to make it wider...

b9_G70c_L5_Qf_Os_Bjd2o_Qd-_TA.png

though if you believe customers are walking away because of a lack of explanation, perhaps safer to stick to a message that in visible without the need for a mouseover event.

 

Link to comment
Share on other sites

Thanks for the detailed explanation, Brian. On further looking I believe it's the "Order Summary" area I need to target with a prorata message, is there a way I could display how exactly it's being prorata'd so the client knows how we have gotten to their "total due today" amount? I mostly sell products with a monthly recurring fee and a set up price FYI if this helps.

Link to comment
Share on other sites

On 2/19/2018 at 13:10, inteldigital said:

On further looking I believe it's the "Order Summary" area I need to target with a prorata message, is there a way I could display how exactly it's being prorata'd so the client knows how we have gotten to their "total due today" amount? I mostly sell products with a monthly recurring fee and a set up price FYI if this helps.

so going from the screenshot, i'm going to assume it's the order summary from the configure product step of the order process...

On 2/19/2018 at 13:49, inteldigital said:

I don't understand how it's getting to this amount and I am assuming it's because of prorata which is why I need it to be shown on the summary, because if it was me purchasing, I'd abandon the cart too because the costs don't add up

sometimes it's worth pausing and just wondering why WHMCS let nonsense like this (and all the unfixed bugs in the cart) go on for so long whilst the development team happily sidetrack themselves adding needless features while the core functionality remains bugged. 49oa9Ad.gif

anyway, with a bit of work, I think that you can customise the order summary display to suit your needs... with a lot more work, you could make it 100% to work with configurable options too (which i'll come to later) - but I see that you're currently not using them, so let's not spend time fixing that issue for now! :)

ca_Lcw_TZSSh2e_Wub_HLROXfw.png

so in the above example, i'm showing both the product base price (£150) and the pro-rata adjusted price (£37.50) - that adjusted price variable is there in a longer format, but needs some tweaking to access it alone... also, if it's a pro-rata product, then i'm adding an asterisk to the total price, and displaying a message at the bottom stating it's a pro-rata product, giving the pro-rata date and what the recurring price will be for the product (in this case, £150 monthly)... that last line may be redundant because it's already implied in the Monthly value already, so you can remove it if you want.

so hopefully now the user can understand that the £1,485.00 total is made up of i) a pro-rata price of £37.50; ii) setup fee of £1,200 and iii) VAT of £247.50 :idea:

rather than posting the code for the whole file, i've attached the updated version of templates/orderforms/standard_cart/ordersummary.tpl for v7.4.2 to this post - and i've commented the parts that i've added (plus there is one more tweak that I didn't comment on - the {if $producttotals.proratadate}<sup>*</sup>{/if} line that adds an asterisk to the total if it's a pro-rata product.).

when it comes to updating WHMCS in the future (with v7.5 just around the corner), you'll probably have to put these changes back in manually as the updater will overwrite them... apart from the two sections below, I haven't changed anything else... so unless WHMCS do something radical with the existing template coding in v7.5 (unlikely), then this should continue to work.

as I hinted at in my previous post, I should really have used Language Overrides for these new strings, but if you need to show any additional strings in the user's native language, then that can easily be added by following the documentation.

{* begin check if pro-rata product with no configurable options *}
	
	{if $producttotals.proratadate and !$producttotals.configoptions}
		<span class="pull-left"><sup>*</sup> {$LANG.orderprorata} Adjusted Price</span>
		<span class="pull-right">{if $producttotals.pricing.setup->toNumeric() gt 0}<b>{$producttotals.pricingtext|strstr:' ':true}</b>{else}<b>{$producttotals.pricingtext}</b>{/if}</span>
	{/if}
	
{* end check if pro-rata product with no configurable options *}
<div class="total-due-today">
    <span class="amt">{$producttotals.pricing.totaltoday} {if $producttotals.proratadate}<sup>*</sup>{/if}</span>
    <span>{$LANG.ordertotalduetoday}</span>
	
{* begin check if pro-rata product *}	
	
	<span>{if $producttotals.proratadate}<br /><sup>*</sup> Initial price adjusted for {$LANG.orderprorata} {$producttotals.proratadate}<br />Recurring price will be {$producttotals.pricing.recurringexcltax.{$producttotals.billingcyclefriendly}} {$producttotals.billingcyclefriendly}{/if}
	
{* end check if pro-rata product *}	

with regards to configurable options, it messes up the ease of the calculation horrendously - there's no single variable that will give you the amount of the prorated base price, let alone the configurable options.... you could calculate them from existing variables with a lot of effort, or calculate the pro rata amounts using the pro rata formula (as you know the price and date)... but then you also get into the realms of it possibly being more confusing for the client to see weird(er) amounts in the order summary.

ordersummary.tpl

Link to comment
Share on other sites

  • 1 month later...
16 hours ago, web2008 said:

How can I show the recurring price included tax in ordersummary.tpl ?

you should just need to change...

{$producttotals.pricing.recurringexcltax.{$producttotals.billingcyclefriendly}}

to...

{$producttotals.pricing.recurring.{$producttotals.billingcyclefriendly}}

 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
  • 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