Jump to content
Sign in to follow this  
brian!

Tutorial: How to replace Payment Gateways (e.g Paypal) text with image or logo (Updated July 2018)

Recommended Posts

19 minutes ago, brian! said:

that doesn't necessarily mean it's legit.... if you buy a stolen car, that doesn't make it your car!

at the very best, it's been customised and so any hook might not necessarily work in the same way.... more likely if it's the company that i'm thinking of, they will have just installed it fir you and told you to come here with any issues.

I can see you're using it, but that won't tell me if you bought it (nor do I care) - I might double check with them tomorrow, but even if you did buy the theme, that doesn't make the WHMCS install legit.

it's your install - YOU are the one with the potentially dodgy license - and liable for any consequences.

yes - you could edit the template and do it... i'll let you find the old post where I mentioned how to do that.

I won't be replying to any of your posts.

You're totally correct. Since there are many resellers, i never thought that the ones who sold it to me and installed it have installed a pirated version.

You may ask Jack whom I bought the theme from. I am not into pirated stuff. On the contrary, i always support the developers.

I understand you not replying to any of my posts. If I knew it is a pirated version, i wouldn't have published my url to the public.

But thank you for informing me so that I can go back to the resellers.

Have a good day.

Share this post


Link to post
Share on other sites

Hello, Nice to meet you

I have a problems for integrate Direct debit  payment method in payment gateway of WHMCS Admin site.  Also card payment have to take the initial payment 

 Also on the order process can make them complete a Direct debit and then take a card payment for the initial payment? Because they will need to pay for the initial payment first and then on going payments will be by direct debit

 I would need to add the function of setting up a Direct Debit via GoCardless as well as taking the initial payment during the signup process

Who can help me

Let me know about that I am a stranger on WHMCS.

Please let me know that

Thanks for your kindly.

Share this post


Link to post
Share on other sites
Posted (edited)
1 hour ago, DeeeExclusive said:

Great job Brian

Is it somehow still possible to view the name of the payment next to the logo?

Add 

$gateway[$key]['name']

next to <img> tag

Edited by pRieStaKos

Share this post


Link to post
Share on other sites
1 hour ago, DeeeExclusive said:

Is it somehow still possible to view the name of the payment next to the logo?

<?php

# Cart Gateway Logos Hook
# Written by brian!

function hook_cart_gateway_logos($vars) {
	
	if ($vars['templatefile'] == 'viewcart') {
		$gateways = $vars['gateways'];
		foreach($gateways as $key => $gateway) {
			$logo = "assets/img/logos/".$key.".png";
			if(file_exists($logo)) {
				$gateways[$key]['name'] = '<div class="row"><div class="col-sm-12 text-center"><img src="'.$logo.'" alt="'.$gateway['sysname'].'"><br />'.$gateway['name'].'</div></div>';
			}
		}			
		return array("gateways" => $gateways);
	}
}
add_hook('ClientAreaPageCart', 1, 'hook_cart_gateway_logos');

qr0Fp3y.png

Share this post


Link to post
Share on other sites
Posted (edited)

Hi Brian,

And can the gateway names also be changed? Like for example: Debit/Credit Card with its logo instead of Stripe.

Thanks, you're awesome!

Edited by companyglue

Share this post


Link to post
Share on other sites
11 minutes ago, companyglue said:

And can the gateway names also be changed? Like for example: Debit/Credit Card with its logo instead of Stripe.

you should be able to do that from the manage existing gateway settings...

https://docs.whmcs.com/Payment_Gateways

... by changing the Display Name value of the gateway you want to rename...

cQX2tww.png

if you had to, you could do it in the hook - but unless you were doing something that I don't think could be done from settings, e.g translating these gateway names for the user's language, then I wouldn't bother hooking for this.

Share this post


Link to post
Share on other sites
1 hour ago, brian! said:

if you had to, you could do it in the hook - but unless you were doing something that I don't think could be done from settings, e.g translating these gateway names for the user's language, then I wouldn't bother hooking for this.

Right on point! The final objective of my question was to include a translation string somewhere in there that would allow exactly that: gateway name translation for users.

Thanks!

Share this post


Link to post
Share on other sites
6 hours ago, brian! said:

<?php

# Cart Gateway Logos Hook
# Written by brian!

function hook_cart_gateway_logos($vars) {
	
	if ($vars['templatefile'] == 'viewcart') {
		$gateways = $vars['gateways'];
		foreach($gateways as $key => $gateway) {
			$logo = "assets/img/logos/".$key.".png";
			if(file_exists($logo)) {
				$gateways[$key]['name'] = '<div class="row"><div class="col-sm-12 text-center"><img src="'.$logo.'" alt="'.$gateway['sysname'].'"><br />'.$gateway['name'].'</div></div>';
			}
		}			
		return array("gateways" => $gateways);
	}
}
add_hook('ClientAreaPageCart', 1, 'hook_cart_gateway_logos');

qr0Fp3y.png

Thanks Brian, owe you big time again.

Is there a way i can donate you some coffee via paypal?

image.png.be66359335cd9777e774bf555ac4f767.png

 

Share this post


Link to post
Share on other sites

@Brian guru

What happen to my whmcs Brian this hook not work too

I have copied from here added to includes/hook

create the folder assets/img/logo and put a paypal.png

refreshed cooky

 

not work I can't belive

whmcs 8.1.3 php 7.4

 

where is the problem ?

Share this post


Link to post
Share on other sites
12 hours ago, tangogc said:

@Brian guru

What happen to my whmcs Brian this hook not work too

I have copied from here added to includes/hook

create the folder assets/img/logo and put a paypal.png

refreshed cooky

 

not work I can't belive

whmcs 8.1.3 php 7.4

 

where is the problem ?

fixed thanks

Share this post


Link to post
Share on other sites
On 05/03/2021 at 17:43, companyglue said:

Right on point! The final objective of my question was to include a translation string somewhere in there that would allow exactly that: gateway name translation for users.

<?php

# Cart Gateway Logos (+Translate) Hook
# Written by brian!

function hook_cart_gateway_logos($vars) {
	
	if ($vars['templatefile'] == 'viewcart') {
		$gateways = $vars['gateways'];
		foreach($gateways as $key => $gateway) {
			$transstring = 'gateway.'.$key;
			$transgateway = Lang::trans($transstring);
			if ($transgateway != $transstring) {
				$gateway['transname'] = $transgateway;
			} else {
				$gateway['transname'] = $gateway['name'];
			}
			$logo = "assets/img/logos/".$key.".png";
			if(file_exists($logo)) {
				$gateways[$key]['name'] = '<div class="row"><div class="col-sm-12 text-center"><img src="'.$logo.'" alt="'.$gateway['sysname'].'"><br />'.$gateway['transname'].'</div></div>';
			}
		}			
		return array("gateways" => $gateways);
	}
}
add_hook('ClientAreaPageCart', 1, 'hook_cart_gateway_logos');

and the language translations would be in the format of...

$_LANG['gateway']['banktransfer'] = "virement bancaire";

znv2hwh.png

the hook could be tweaked to show different logos per gateway based on the current language... but that way lies madness - you shouldn't really need different logos for the same gateway! 🤪

Share this post


Link to post
Share on other sites
On 08/06/2021 at 13:41, huahin said:

does this still work for Version: 8.1.3 ?

yes.

Share this post


Link to post
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.

Sign in to follow this  

  • Similar Content

    • By KangLeian
      Is there somebody can help me where the setting or what should i do for my problem.
      The problem is when i tried to change currency at user side it won't changed. I have 2 currency that been used. First, USD (default) and my local currency IDR. when i try to change the currency on user side from USD to IDR it won't change and just go back to USD. I've try to inspect element that USD has id=1 and IDR id=2. When i clicked to IDR it's return to USD and not changed. If there any solve issue like this please share the answer link here. thank you very much. 
      note: I'm using payment gateway from my local country. It won't accept any other currencies for now. So, i need to used my local currencies. And i still need USD for compare rate.
      r8Cynm9EQr.mp4
    • By Majd
      Hello WHMCS community, I would like to transform the two decimal point format in the payement part to three decimal point(for example : 120,565 not supported by WHMCS). I think it will be about a dashboard configuration. If you have solutions please answer me and thank you.
    • By hamza.cb
      Hello. 
      We are using WHMCS for billing our customers. Our customers are reporting us an issue related to payment through credit card(stripe) without registering.
      An error occurred of an invalid date. 
      BUT when they register and we send them a custom invoice, then the same credit card is working for them.
      Regards,
      Hamza

    • By AhmedmZaki
      i want to integrate new third party method i fowled the documentation and the payment is redirect back to the success link but the invoice id is always zero knet.php 

      knet.php
    • By AhmedmZaki
      i'm try to add new payment method "third party " it's ok i added to thw whmcs also the payment is redirected to the payment portal but when it's come back i get error

      knet.php
  • 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