mino Posted August 26, 2019 Share Posted August 26, 2019 Is it possible to change title company name only in viewinvoice.php page 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted August 26, 2019 Share Posted August 26, 2019 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"); }); 1 Quote Link to comment Share on other sites More sharing options...
mino Posted August 26, 2019 Author Share Posted August 26, 2019 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! 0 Quote Link to comment Share on other sites More sharing options...
mino Posted August 26, 2019 Author Share Posted August 26, 2019 @brian! 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 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted August 26, 2019 Share Posted August 26, 2019 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. 1 Quote Link to comment Share on other sites More sharing options...
mino Posted August 26, 2019 Author Share Posted August 26, 2019 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 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted August 26, 2019 Share Posted August 26, 2019 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! 1 Quote Link to comment Share on other sites More sharing options...
mino Posted August 26, 2019 Author Share Posted August 26, 2019 Ok im wait thank you for your time @brian! 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted August 27, 2019 Share Posted August 27, 2019 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); } }); 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"; 1 Quote Link to comment Share on other sites More sharing options...
mino Posted August 27, 2019 Author Share Posted August 27, 2019 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); } }); 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 0 Quote Link to comment Share on other sites More sharing options...
ManagedCloud-Hosting Posted November 19, 2020 Share Posted November 19, 2020 Hi @brian! Does this change the company name with pdf invoices too ? Thanks 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted November 20, 2020 Share Posted November 20, 2020 19 hours ago, VirtualWorldGlobal said: Does this change the company name with pdf invoices too ? as the invoicepdf template doesn't use hooks, the answer is no. 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.