Jump to content
  • 0

Hook design


Deepu3110

Question

Hello

I am using the below hook

<?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');
?>

But i want to display option like this

image.thumb.png.ede75fdf1f322213ed4c81e0475926df.png

 

Can anyone help to make this ?

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0
5 hours ago, Deepu3110 said:

Can anyone help to make this ?

you wouldn't necessarily need a module for that, you're simply changing the output that the hook generates... and I suppose tweaking the logic a little as the hook assumes the logo filename is the same as the gateway, whereas in the above screenshot, the FA5 logo used might not necessarily use the same code as the gateway name.

depending on the theme, this might be easier in the template than tweaking the array via a hook - as there may be layout changes required, and i'd have to have to resort to modifying elements via jQuery.

i'd probably need to see/know the theme and WHMCS release you're using - that screenshot looks like the bredh template, but I don't know if it's a mockup or whether bredh does that already (their demo is poorly setup, so I can't get to checkout to see).

Link to comment
Share on other sites

  • 0
5 minutes ago, Deepu3110 said:

but i am using modern theme of whmcs and want to design like this, img with text like you seen the img.

are you upgrading to v8 any time soon?? I ask because Modern has been removed from v8...

https://docs.whmcs.com/Version_8.0.0_Release_Notes#Removed_Boxes_and_Modern_Templates

... and therefore, you'd have to use standard_cart. or alternative.

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
Answer this question...

×   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