inthanet Posted August 30, 2015 Share Posted August 30, 2015 Hi, i'm looking for an way you i can change the address format (client area home) Standard is: Name, Street, City, County, Zip, Country I need: Name, Street, Zip, City, County, Country i58.tinypic.com/25p5k05.jpg 0 Quote Link to comment Share on other sites More sharing options...
inthanet Posted September 1, 2015 Author Share Posted September 1, 2015 I found the right way how to do. If the follow code running as hook it will change the address block as desire. use Carbon\Carbon; use WHMCS\View\Menu\Item as MenuItem; if (App::getCurrentFilename() == 'clientarea') { add_hook('ClientAreaPrimarySidebar', 1, function (MenuItem $primarySidebar) { $client = Menu::context('client'); if($client->country == "DE") { if($client->companyname != ""){ $name = '<strong>'.$client->companyname.'</strong>'; } else { $name = '<strong>'.$client->fullname.'</strong>'; } $address1 = $client->address1; if($client->address2 != ""){$address2 = '<br>'.$client->address2;}else{$address2="";} $city = ' '.$client->city; $state = '<br>'.$client->state; $postcode = '<br>'.$client->postcode; $country = '<br>'.$client->countryname; $address_de = $name."<p>".$address1.$address2.$postcode.$city.$state.$country."</p>"; // Create the new Address Block panel and make sure it's the first one // displayed. /** @var MenuItem $newAddressBlock */ $newAddressBlock = $primarySidebar->addChild('Client Details'); $newAddressBlock->moveToFront(); // Add AddressBlock to the panel. $newAddressBlock->addChild( $address_de ); } }); } 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.