Jump to content

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


brian!

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.

Link to comment
Share on other sites

  • 2 weeks later...

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.

Link to comment
Share on other sites

  • 3 months later...
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

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

Link to comment
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!

Link to comment
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

 

Link to comment
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 ?

Link to comment
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

Link to comment
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! 🤪

Link to comment
Share on other sites

  • 2 months later...
  • 4 months later...

I may not understand it, but a person can pay for a legally purchased WHMCS every time a new version is released, as it was before, or simply stop renewing the subscription as it is now and use the old version. For example, after changing the company's policy and switching to a subscription, we did not extend the license period. This does not make the user a pirate. Maybe I misunderstood, but I'm one of the first people who was helped in this topic by Brian for displaying logos on the site, but it doesn't work for me now either. I absolutely don't understand why.

Link to comment
Share on other sites

1 hour ago, Tengri said:

a person can pay for a legally purchased WHMCS every time a new version is released, as it was before, or simply stop renewing the subscription as it is now and use the old version

No. Now that they've done away with the owned license level by no longer selling support for it, any and all licenses are forced to pay the subscription to receive support and updates moving forward. You can't but a new license that isn't leased in this manner, and if you stop paying for the lease at any point (even if it was an owned version converted to this), you lose access to the admin. 

Lease == hostage. You *must* keep paying to retain access. 

Link to comment
Share on other sites

14 часов назад медведь сказал:

Нет. Теперь, когда они отказались от уровня собственных лицензий, больше не продавая его поддержку, все без исключения лицензии вынуждены оплачивать подписку, чтобы получать поддержку и обновления. Вы не можете не получить новую лицензию, которая не предоставляется в аренду таким образом, и если вы перестанете платить за аренду в любой момент (даже если это была собственная версия, преобразованная в эту), вы потеряете доступ к администратору. 

Сдам в аренду == заложник. Вы * должны * продолжать платить, чтобы сохранить доступ. 

Hi!

Yes, of course. For example we use 8.1.3 and don't change to montly subscribe. And we still use legal version. But also, hooks doesn't work for me now :). Why? I don't know. We don't change anything.

Link to comment
Share on other sites

On 08.03.2021 at 19:15, brian! said:






 
	
	    
		   
			   
			   
			 
			   
			
					
		 
	
  

iar traducerile în limbă ar fi în formatul...


  

znv2hwh.png

cârligul ar putea fi ajustat pentru a arăta logo-uri diferite pentru fiecare gateway în funcție de limba actuală... dar așa este nebunia - nu ar trebui să aveți nevoie de logo-uri diferite pentru același gateway! 🤪

brian!  you can make a more concrete tutorial on this because I don't understand how to make it functional

Link to comment
Share on other sites

13 hours ago, redsky said:

brian!  you can make a more concrete tutorial on this because I don't understand how to make it functional

He's stopped visiting much and doesn't do this volunteer stuff any longer. Up to him if he shows up and responds, but based on his recent behavior, I'd say it's unlikely any time soon. I wish you luck, but help is probably not on the way. 😉

Link to comment
Share on other sites

  • 6 months later...

Hello, Im trying this options but it wont work. Where do i need to add the file for:

<?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'] = '<img src="'.$logo.'" alt="'.$gateway['sysname'].'">';
			}
		}			
		return array("gateways" => $gateways);
	}
}
add_hook('ClientAreaPageCart', 1, 'hook_cart_gateway_logos');
?>

Please help, Theme Hostx

Link to comment
Share on other sites

  • 1 month later...

Friends, I don't really understand what I have to do, I have two forms of payment, I need to make two hooks as shown below? when I change  $logo = "assets/img/logos/visa.png"; it puts the image in both forms of payment! Where do I change it to put the right images on each payment method? Is it working on version 8.5.1?
Thanks

<?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');
Link to comment
Share on other sites

  • 2 months later...

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.

×
×
  • 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