I am using Kody kreskowe - EAN-13
by Jacek Kowalski (http://jacekk.info) to generate EAN13 barcode and save it to image file. I would like generate barcode dynamically during the ordering process in Prestashop. Save that image on server and put it in new_order.html email template.
There is whole code: https://jacekk.info/skrypty/ean13.phps
I modified it lightly by change $_GET['kod']
to $kod_in
and put $kod_in = 1234567891011
at start of file and imagepng($i, $new_filename);
at the end
Everything works well (I see generated barcode and script create new image file and save it on server) when I enter directly to file ean13.php or if I run that code (directly in web browser):
$kod_in = 1234567891011;
include (dirname(__FILE__)."/ean13.php");
But when I try include the above code into order process, exactly in mailalerts.php, it does not display barcode and generate blank (white) image file. I think it has something to do with the fact that the generated barcode is not displayed on the screen, and then is saved.
Please help modify the code to generate the images even though they are not displayed on the screen.
At the end of the script replace this:
With this:
Here is
imagegif
DocumentationYou can use this library as a Class this way:
You need to include it once at the top of your file before your class declaration:
Now instead of including the script to generate an image you'll have to create a new
BarCode
Object.Tested and working on my Prestashop 1.6.