Jump to content

Showing "Payment Method" on Summary Page - Making it "Friendly"


Recommended Posts

Dear All,

I very much liked the code from @brian! to display (for products) the payment method.  Very neat.

However, I was wondering how you make what is displayed a little more friendly.  i.e. instead of mailin being shown, it should be shown as Mail Payment.  And instead of banktransfer it said Direct Bank Transfer.  Just something a little more readable or the clients. 

I am not an expert in coding, so would appreciate some understanding of how to achieve this. 

Thanks in advance.

Regards,
Brad  

 

Link to comment
Share on other sites

Hi Brad,

15 minutes ago, sanechoice said:

I very much liked the code from @brian! to display (for products) the payment method.  Very neat.

that's kind of you to say - a shame the thread got closed... it's a silly policy to close threads too early here, but there you go.

16 minutes ago, sanechoice said:

However, I was wondering how you make what is displayed a little more friendly.  i.e. instead of mailin being shown, it should be shown as Mail Payment.  And instead of banktransfer it said Direct Bank Transfer.  Just something a little more readable or the clients. 

the problem is that the template doesn't have access to that information - you'd effectively have to query the database to get the friendly name for mailin, banktransfer etc...

one way to avoid doing that would just be to use an {if} statement in the template instead, e.g change...

<td>{$product.dpaymentmethod}</td>

to...

<td>{if $product.dpaymentmethod eq 'mailin'}Mail Payment{elseif $product.dpaymentmethod eq 'banktransfer'}Direct Bank Transfer{else}{$product.dpaymentmethod}{/if}</td>

i99h13B.png

Link to comment
Share on other sites

Hi Brad,

46 minutes ago, sanechoice said:

Thanks @brian! however, unless I am going mad (possible) I cannot see the below file in the templates folder.

sadly, going mad is one of the side-effects of using WHMCS - you likely won't notice it yet after two years, but it slowly creeps in during the third year! 😝

46 minutes ago, sanechoice said:

Is this this the right TPL file to edit?

yes, but it's an admin template, so you should be looking in /admin/templates/blend/clientsummary.tpl - I daresay it would work in v4 too, with some tweaks.

Link to comment
Share on other sites

2 hours ago, brian! said:

sadly, going mad is one of the side-effects of using WHMCS - you likely won't notice it yet after two years, but it slowly creeps in during the third year!

 

Yep - sounds about the right time for it.

2 hours ago, brian! said:

yes, but it's an admin template, so you should be looking in /admin/templates/blend/clientsummary.tpl - I daresay it would work in v4 too, with some tweaks.

Ah - good point.  I wonder, however, if the same code and principal will work in the client template?  i.e. adding Payment Method to the Services Summary page. 

Link to comment
Share on other sites

44 minutes ago, sanechoice said:

I wonder, however, if the same code and principal will work in the client template?  i.e. adding Payment Method to the Services Summary page. 

if you mean in clientarea.php?action=services, then no it wouldn't - it works in the Admin Client Summary page because the payment method value is already there in the array (but unused).

in the client area, the $services array doesn't contain payment method and therefore there's nothing to output.

if you were going to do this in the client area, then one way would be to write an action hook to take the $services array from the template; loop through the array; query the database for the payment method for each service; add the value to the array and then return the updated array to the template... and then edit the template to include this new column heading and values.

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