Totally Zenned
- Join Date:
- Sep 2008
- Location:
- DownUnder, overlooking South Pole.
- Posts:
- 1,018
- Plugin Contributions:
- 2
Company Name after Customer Name (instead of before)
Back in 2008, Dr Byte kindly provided a solution to display the company name after the customer name.
1. Edit /includes/functions/functions_customers.php. Around line 108 you'll see code that looks like this. Add the additional code as shown:
Code:
if ( (ACCOUNT_COMPANY == 'true') && (zen_not_null($company)) && !strpos($fmt, '$company') ) {
$address_out = $company . $cr . $address_out;
}
2. Using phpMyAdmin, open the "address_format" table, and edit the value in the address_format column for address_format_id record #2 by adding $cr$company right after $lastname
That will affect all addresses for all customers whose country's standard address formatting is set to address_format_id #2 (USA is set to use #2 by default).
As discussed in this closed thread:
https://www.zen-cart.com/showthread.php?104358-Customer-Address-Formatting-and-Company-Name
The code works but with one small problem, that if no company name is provided, a blank line will appear between the customer name and the address, which does not look good.
Having spent much of the day trying to fix this problem, I now seek help to remove the blank line when no company name is provided.
Thanks