Image Product In ODT Template

How to display images of products in ODT Template ?
Help me <<<!!!

Hello,

As far as I know this is not possible.

1 Like

So why do we do that on PDF Template ?

Hi,
Are you asking why or how to do that on pdf template?
For how see this link:
https://wiki.dolibarr.org/index.php/Setup_Other
Go to: Home ► Setup -> Other Setup
The below are what you need:
MAIN_GENERATE_PROPOSALS_WITH_PICTURE ► Include the first image of the product into the line of the generated PDF for customer proposals.

MAIN_GENERATE_INVOICES_WITH_PICTURE ► Include the first image of the product into the line of the generated PDF for customer invoices. 

MAIN_GENERATE_SUPPLIER_PROPOSAL_WITH_PICTURE ► Include the first image of the product into the line of the generated PDF for supplier proposals ► (v5.0.3+)

Hello ?

I do not understand your question…

Yes it is possbile to do with PDF.
ODT is there for simple things, If you want more complexe one go PDF

I want to print the image of the product on the odt template

You cannot display images using ODT template.

It is possible in PDF because you hand code everything in the PDF file using PHP and the FPDF library, so you can get the product image, set its size, etc.

ODT templates use PHP text substitution to replace the available tags with data elements from the relevant object(s) - there’s no image substitution.

oh no, why do we printed the company logo?
But for the image of the product, it cannot be printed, even though they are all image files. (?)

Sorry, let me rephrase my previous answer.

There is a built in substitution for the company logo but there are no other image substitutions that are built in.

You’d have to modify the dolibarr source code that does the substitutions, see how it handles the company logo image, copy-paste that, and modify it to do the same thing for the product image(s).

I recently added tags for the shipment module and had to edit a core/class ( core/class/commondocgenerator.class.php) file to make it work - and that file only handles the values, so I could see that it would not be that hard to add a new tag called {product_image} and get the name of the image file from the database, but you’d have to dig into the substitution code ( which is in core/lib/functions.lib.php) to see how to write the image into the odt.

Hi, can you please explain step by step process to include product image in ODT template.

Thank you so much. It worked…
I want to change and add some fields in invoice. Please guide me

Thank you

Hi, can you please explain step by step process to include product image in ODT template.

Regards.

Hi Ali,

Can you please let me know whether you have already created :
(a) Signature in ODT file using : {USER_SIGNATURE}
(b) Barcode of Invoice
(c) Barcode of product

If yes, can you kindly share how this needs to be done using ODT to PDF in Invoices.

thanks
yesbee