# Editing Dolibarr

**URL:** <https://www.dolibarr.org/forum/t/editing-dolibarr/21050>\
**Category:** Developing for Dolibarr\
**Created:** [August 13, 2021, 4:15pm UTC](https://www.dolibarr.org/forum/t/editing-dolibarr/21050 "2021-08-13T16:15:13Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![gerstavros](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/g/54ee81/32.png) [@gerstavros](https://www.dolibarr.org/forum/u/gerstavros)\
**Post date:** [August 13, 2021, 4:15pm UTC](https://www.dolibarr.org/forum/t/editing-dolibarr/21050/1 "2021-08-13T16:15:13Z")

</div>

Hello  
I am trying to customize my Dolibarr installation at my company’s needs.  
I have currently two questions.

1. Is there a way in Dolibarr to create code overrides, to avoid editing core files and doing updates easily?
2. I can’t manage to find parts of code of the tabs in modules like fichinder, commande, societe. For example in fichinder/card.php can’t find the code above `<div class="refidno">`, like pagination, tabbar, statusref. Obviously they’re in other file, but I 'm missing it, although I 'm reading the wiki

Thanks in advance

---

<div class="post-metadata">

**Author:** ![priojk](https://www.dolibarr.org/forum/user_avatar/www.dolibarr.org/priojk/32/6121_2.png) [@priojk](https://www.dolibarr.org/forum/u/priojk)\
**Post date:** [August 13, 2021, 8:59pm UTC](https://www.dolibarr.org/forum/t/editing-dolibarr/21050/2 "2021-08-13T20:59:53Z")

</div>

Regarding 1.:

Depending on what you need to customize, it is advisable to do this by building a custom module like it is described here:

[https://wiki.dolibarr.org/index.php?title=Module\_development](https://wiki.dolibarr.org/index.php?title=Module_development)

In many cases, if you need to perform additional actions after certain events happen (e.g. a bill gets marked as paid), there are triggers available. In this case, the trigger BILL\_PAYED can be used within a custom module to perform additional actions.

To modify/extend functionality performed by Dolibarr, you can use hooks.

The Wiki provides a good step by step explanation of how an own module can be created and a module builder is part of Dolibarr, which helps you with the required steps. But depending on your experience level, there is still some learning curve.

However, if you absolutely need to make changes in the core files, it might help to use git and also make future updates based on git to help with merge conflicts and avoid overrides.

---

<div class="post-metadata">

**Author:** ![gerstavros](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/g/54ee81/32.png) [@gerstavros](https://www.dolibarr.org/forum/u/gerstavros)\
**Post date:** [August 14, 2021, 8:21am UTC](https://www.dolibarr.org/forum/t/editing-dolibarr/21050/3 "2021-08-14T08:21:03Z")

</div>

Thank you. This is the wiki for anyone else looking for it: [Hooks system - Dolibarr ERP CRM Wiki](https://wiki.dolibarr.org/index.php?title=Hooks_system)

---

<div class="post-metadata">

**Author:** ![Rasha](https://www.dolibarr.org/forum/user_avatar/www.dolibarr.org/rasha/32/5356_2.png) [@Rasha](https://www.dolibarr.org/forum/u/Rasha)\
**Post date:** [August 30, 2023, 8:24pm UTC](https://www.dolibarr.org/forum/t/editing-dolibarr/21050/4 "2023-08-30T20:24:03Z")

</div>

hello ,  
i would like to ask if there is a way to overwrite an index file like for exemple `compta\facture\index.php`  
it doesn’t containe any hooks , also its possible if i did a copy directly inside custom like so  
` custom\compta\facture\index.php`  
but if i replace it under my custome module like so  
`custom\my_module\compta\facture\index.php`  
it doesn’t work , is there is a way to make my modifications on index.php using my\_module ?

---

<div class="post-metadata">

**Author:** ![ksar](https://www.dolibarr.org/forum/user_avatar/www.dolibarr.org/ksar/32/514_2.png) [@ksar](https://www.dolibarr.org/forum/u/ksar)\
**Post date:** [August 30, 2023, 8:43pm UTC](https://www.dolibarr.org/forum/t/editing-dolibarr/21050/5 "2023-08-30T20:43:56Z")

</div>

Hello,

I don’t think that’s possible.

---

<div class="post-metadata">

**Author:** ![Rasha](https://www.dolibarr.org/forum/user_avatar/www.dolibarr.org/rasha/32/5356_2.png) [@Rasha](https://www.dolibarr.org/forum/u/Rasha)\
**Post date:** [August 30, 2023, 9:02pm UTC](https://www.dolibarr.org/forum/t/editing-dolibarr/21050/6 "2023-08-30T21:02:46Z")

</div>

idk, but i sitll want to try, i belive there is a way hhhh

---

<div class="post-metadata">

**Author:** ![altatof](https://www.dolibarr.org/forum/user_avatar/www.dolibarr.org/altatof/32/2426_2.png) [@altatof](https://www.dolibarr.org/forum/u/altatof)\
**Post date:** [September 5, 2023, 12:38pm UTC](https://www.dolibarr.org/forum/t/editing-dolibarr/21050/7 "2023-09-05T12:38:01Z")

</div>

Hello, all dolibarr files include main.inc.php  
Maybe you should try to use the hook printMainArea :wink:  
I never did it but it might be a good idea.  
You have to test the $\_SERVER[‘ineverknowwhichentry’] to match the compta/facture/index.php and then print your content and exit; it should do the job.  
please tell me if it works.

---

<div class="post-metadata">

**Author:** ![altatof](https://www.dolibarr.org/forum/user_avatar/www.dolibarr.org/altatof/32/2426_2.png) [@altatof](https://www.dolibarr.org/forum/u/altatof)\
**Post date:** [September 5, 2023, 12:50pm UTC](https://www.dolibarr.org/forum/t/editing-dolibarr/21050/8 "2023-09-05T12:50:22Z")

</div>

UPDATE : i’ve just made it work 🙂  
In your actions\_yourmodule.class.php, you just have to create a new function :

```auto
	function printMainArea($parameters) {
        global $langs;

        if ($_SERVER['SCRIPT_FILENAME'] == DOL_DOCUMENT_ROOT . '/compta/facture/index.php') {
			print load_fiche_titre($langs->trans("CustomersInvoicesArea"), '', 'bill');
			print 'it works';
			exit;
		}
	}

```

![image](https://www.dolibarr.org/forum/uploads/dolibarrorg/original/2X/e/e35ff43768572cdf60813955a3b197b3031cb63b.png)

---

<div class="post-metadata">

**Author:** ![Rasha](https://www.dolibarr.org/forum/user_avatar/www.dolibarr.org/rasha/32/5356_2.png) [@Rasha](https://www.dolibarr.org/forum/u/Rasha)\
**Post date:** [September 21, 2023, 11:02am UTC](https://www.dolibarr.org/forum/t/editing-dolibarr/21050/9 "2023-09-21T11:02:56Z")

</div>

it worked for me too, thank you

---

<div class="post-metadata">

**Author:** ![ksar](https://www.dolibarr.org/forum/user_avatar/www.dolibarr.org/ksar/32/514_2.png) [@ksar](https://www.dolibarr.org/forum/u/ksar)\
**Post date:** [January 3, 2024, 9:06am UTC](https://www.dolibarr.org/forum/t/editing-dolibarr/21050/10 "2024-01-03T09:06:00Z")

</div>

Hello,

I just came to know that there is an external module that allows page overwritting : [Dolibarr extension / dolibarr\_module\_pagessubstitution · GitLab](https://git.open-dsi.fr/dolibarr-extension/pagessubstitution)

---

<div class="post-metadata">

**Author:** ![altatof](https://www.dolibarr.org/forum/user_avatar/www.dolibarr.org/altatof/32/2426_2.png) [@altatof](https://www.dolibarr.org/forum/u/altatof)\
**Post date:** [January 6, 2024, 9:02am UTC](https://www.dolibarr.org/forum/t/editing-dolibarr/21050/11 "2024-01-06T09:02:43Z")

</div>

Hello ksar, this module was not updated since 3 years… i dont know if it still works

---

<div class="post-metadata">

**Author:** ![ksar](https://www.dolibarr.org/forum/user_avatar/www.dolibarr.org/ksar/32/514_2.png) [@ksar](https://www.dolibarr.org/forum/u/ksar)\
**Post date:** [January 6, 2024, 9:17am UTC](https://www.dolibarr.org/forum/t/editing-dolibarr/21050/12 "2024-01-06T09:17:00Z")

</div>

Hello @altatof,

I will just quote Alexandre :

> [@aspangaro-Easya](#):
>
> Tested on dolibarr version 14.0.5/15.0.2/16.0.1/17.0.3/18.0.3/19.0 beta, no issue.

> **[Surcharger un fichier natif par un fichier provenant d'un module (+ BONUS...](https://www.dolibarr.fr/forum/t/surcharger-un-fichier-natif-par-un-fichier-provenant-dun-module-bonus-recuperation-rowid-llx-facture-fourn-det/45151/10)**
>
> Après vérification sur une instance dolibarr en 17.0.2, le module fonctionne. J’en conclus que le module n’est pas compatible avec la dernière version de dolibarr. Une idée de si le module va avoir une version compatible avec la 18.0.2 ? Sinon...

The best soups are made in the oldest pans 🙃

---

<div class="post-metadata">

**Author:** ![victoracho](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/v/51bf81/32.png) [@victoracho](https://www.dolibarr.org/forum/u/victoracho)\
**Post date:** [February 23, 2025, 10:48pm UTC](https://www.dolibarr.org/forum/t/editing-dolibarr/21050/13 "2025-02-23T22:48:38Z")

</div>

Hi there, can you explain what does that printMainArea function do ? I would like to do that as well for the card.php of the compta/facture/card.php, I want to override the script and change few things, I tried with that function but it doesnt work.

---

<div class="post-metadata">

**Author:** ![altatof](https://www.dolibarr.org/forum/user_avatar/www.dolibarr.org/altatof/32/2426_2.png) [@altatof](https://www.dolibarr.org/forum/u/altatof)\
**Post date:** [April 6, 2025, 1:40pm UTC](https://www.dolibarr.org/forum/t/editing-dolibarr/21050/14 "2025-04-06T13:40:19Z")

</div>

hello, it’s a hook that replaces the content of the page.
