Jump to content

change company name in viewinvoice.php


mino

Recommended Posts

37 minutes ago, mino said:

Is it possible to change title company name only in viewinvoice.php page 

it uses the value from General Settings -> General -> Company Name... so if you want to change it on all pages, just edit the value in there...

... if you only want to change it on the invoice page...

<?php
add_hook('ClientAreaPageViewInvoice', 1, function($vars) {
    return array ("companyname" => "The Brian Mega Corporation");
});
Link to comment
Share on other sites

42 minutes ago, brian! said:

it uses the value from General Settings -> General -> Company Name... so if you want to change it on all pages, just edit the value in there...

... if you only want to change it on the invoice page...


<?php
add_hook('ClientAreaPageViewInvoice', 1, function($vars) {
    return array ("companyname" => "The Brian Mega Corporation");
});

Thank You @brian!

Link to comment
Share on other sites

41 minutes ago, mino said:

why not change name of company in paypal payment if you need paid with paypal show company name but me ineed change name company for display in paypal

that hook would not change the company name passed to PayPal, it's only for show on the invoice page header.

Link to comment
Share on other sites

2 minutes ago, brian! said:

that hook would not change the company name passed to PayPal, it's only for show on the invoice page header.

Its possible hook or any solution change the company name passed to paypal without change company name global

Link to comment
Share on other sites

8 minutes ago, mino said:

Its possible hook or any solution change the company name passed to paypal without change company name global

yes, it's possible with a hook... it's just going to be a string replace on some hidden fields - leave it with me and i'll post it tomorrow as i'm sure that i've written this before!

Link to comment
Share on other sites

try the following...

<?php

# Change Company Name on PayPal Invoice Link Hook
# Written by brian!

use WHMCS\Config\Setting;

add_hook('ClientAreaPageViewInvoice', 1, function($vars) {
	
	if ($vars['paymentmodule'] == 'paypal') {
		$companyname = Setting::getValue('CompanyName');
		$newcompany = "The Brian Mega Corporation";
		$paymentbutton = $vars['paymentbutton'];
		$newbutton = str_replace($companyname, $newcompany, $paymentbutton);
		return array("paymentbutton" => $newbutton);
	}
});

Jy2t9tg.png

the only line in the hook that you should need to change is the name of the company to be used at PayPal..

$newcompany = "The Brian Mega Corporation";
Link to comment
Share on other sites

5 hours ago, brian! said:

try the following...


<?php

# Change Company Name on PayPal Invoice Link Hook
# Written by brian!

use WHMCS\Config\Setting;

add_hook('ClientAreaPageViewInvoice', 1, function($vars) {
	
	if ($vars['paymentmodule'] == 'paypal') {
		$companyname = Setting::getValue('CompanyName');
		$newcompany = "The Brian Mega Corporation";
		$paymentbutton = $vars['paymentbutton'];
		$newbutton = str_replace($companyname, $newcompany, $paymentbutton);
		return array("paymentbutton" => $newbutton);
	}
});

Jy2t9tg.png

the only line in the hook that you should need to change is the name of the company to be used at PayPal..


$newcompany = "The Brian Mega Corporation";

Thank You  its work very good

 

Link to comment
Share on other sites

  • 1 year 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.

  • 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