Module CustomFields Cases: Difference between revisions

Jump to navigation Jump to search
→‎Implementing the change of price in the Dolibarr interface: Added paths of template files for Dolibarr 3.2 and 3.1
(→‎Implementing the change of price in the Dolibarr interface: Added paths of template files for Dolibarr 3.2 and 3.1)
Line 408: Line 408:
== Implementing the change of price in the Dolibarr interface ==
== Implementing the change of price in the Dolibarr interface ==


Unluckily there is not (yet) any hooking context to modify how lines of products/services are printed, thus the only thing you can do is directly edit the '''htdocs/core/tpl/objectline_view.tpl.php''' template file, then load your customfield manually and print it the way you want using HTML formatting, for our example:
Unluckily there is not (yet) any hooking context to modify how lines of products/services are printed, thus the only thing you can do is directly edit the '''template file''' template file, then load your customfield manually and print it the way you want using HTML formatting, for our example:


In objectline_view.tpl.php, find the following code:
* For Dolibarr 3.3 and above, edit the file '''htdocs/core/tpl/objectline_view.tpl.php'''
* For Dolibarr 3.1 and 3.2, edit the file '''htdocs/core/tpl/freeproductline_view.tpl.php''' AND '''predefinedproductline_view.tpl.php''' (apply the same changes to both files)
 
In the template file you opened, find the following code:
<source lang="php">
<source lang="php">
<?php echo price($line->total_ht); ?>
<?php echo price($line->total_ht); ?>
439

edits

Navigation menu