# How can I get the 'civilite' for a customer?

**URL:** <https://www.dolibarr.org/forum/t/how-can-i-get-the-civilite-for-a-customer/9576>\
**Category:** Using my Dolibarr\
**Created:** [March 21, 2013, 5:03pm UTC](https://www.dolibarr.org/forum/t/how-can-i-get-the-civilite-for-a-customer/9576 "2013-03-21T17:03:53Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![DolibarUser](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/d/9fc348/32.png) [@DolibarUser](https://www.dolibarr.org/forum/u/DolibarUser)\
**Post date:** [March 21, 2013, 5:03pm UTC](https://www.dolibarr.org/forum/t/how-can-i-get-the-civilite-for-a-customer/9576/1 "2013-03-21T17:03:53Z")

</div>

Could please someone tell me, how I can get the translated ‘civilite’ (salutation/title) like “Madame” or “Mister” or “Doktor” from a customer to use in postal address?

What php code-snippet do I have to use?

---

<div class="post-metadata">

**Author:** ![HubZ](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/h/e79b87/32.png) [@HubZ](https://www.dolibarr.org/forum/u/HubZ)\
**Post date:** [March 21, 2013, 6:58pm UTC](https://www.dolibarr.org/forum/t/how-can-i-get-the-civilite-for-a-customer/9576/2 "2013-03-21T18:58:22Z")

</div>

Is it for a third-party or for a contact. If you record the contact, so it should be written if you select the contact in the contact/adresses on the proposal/ order or invoice screen, and it should be displayed on a pdf.

EDIT: sorry i misunderstood the question : it should be somewhere in the langs.php file, no ?

Or go directly in the DB looking for the table llx\_civilite or smthg like this :wink:

---

<div class="post-metadata">

**Author:** ![DolibarUser](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/d/9fc348/32.png) [@DolibarUser](https://www.dolibarr.org/forum/u/DolibarUser)\
**Post date:** [March 21, 2013, 8:59pm UTC](https://www.dolibarr.org/forum/t/how-can-i-get-the-civilite-for-a-customer/9576/3 "2013-03-21T20:59:18Z")

</div>

Sorry for my unclear question:

You will find the snippet in the pdf\_crabe.modules.php for a invoice:

> [@](#):
>
> ```
> // Recipient name
> if (! empty($usecontact))
> {
> if (! empty($conf-\>global-\>MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socname = $object-\>contact-\>socname;
> else $socname = $object-\>client-\>nom;
> $carac_client_name=$outputlangs-\>convToOutputCharset($socname);
> }
> else
> {
> 
> ```
> 
> $carac\_client\_name=$outputlangs-\>convToOutputCharset($object-\>client-\>nom);   
> }

In the green case, I would like to see something like this as result:  
Mister Flash Gordron  
Somestreetname  
1234 Planet City

Actually, I only get the FirstName and LastName but without the title/salutation/civilite.

How do I have to adjust the php code the get the red marked part for single private person (not a company nor a contact of a company).

---

<div class="post-metadata">

**Author:** ![DolibarUser](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/d/9fc348/32.png) [@DolibarUser](https://www.dolibarr.org/forum/u/DolibarUser)\
**Post date:** [August 11, 2013, 8:21am UTC](https://www.dolibarr.org/forum/t/how-can-i-get-the-civilite-for-a-customer/9576/4 "2013-08-11T08:21:20Z")

</div>

I found it in `
$object->contact->civilite_id`

Now I use it with code lines like this:`
if ($object->contact->civilite_id) $MyTitle=$langs->transnoentities("Civility".$object->contact->civilite_id);
...
$pdf->MultiCell(100, 4, $MyTitle, 0, 'L');`

---

<div class="post-metadata">

**Author:** ![HubZ](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/h/e79b87/32.png) [@HubZ](https://www.dolibarr.org/forum/u/HubZ)\
**Post date:** [August 11, 2013, 1:19pm UTC](https://www.dolibarr.org/forum/t/how-can-i-get-the-civilite-for-a-customer/9576/5 "2013-08-11T13:19:13Z")

</div>

well done, i was about to answer long time ago but with an error :  
$object-\>client-\>civilite… but it didn’t work for me, so i didn’t answer.  
Thanks for your tip, and sry for my non-answer :wink:  
Regards,

---

<div class="post-metadata">

**Author:** ![DolibarUser](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/d/9fc348/32.png) [@DolibarUser](https://www.dolibarr.org/forum/u/DolibarUser)\
**Post date:** [January 7, 2015, 11:04am UTC](https://www.dolibarr.org/forum/t/how-can-i-get-the-civilite-for-a-customer/9576/6 "2015-01-07T11:04:53Z")

</div>

Please note that from version 3.6.x the field ‘civilite\_id’ changed its name!  
Actually, you have to use:

`
$object->contact->civility_id`  
From the [changelog](http://www.dolibarr.org/87-news/announces/170-dolibarr-erp-crm-3-6-0-is-available):

> [@](#):
>
> - Properties “civilite\_id” were renamed into “civility\_id”
