neetupahwa Posted November 10, 2013 Share Posted November 10, 2013 I am trying to add Order number & Order Date under the Invoice number in header.tpl file. How can I access the order number and order date variable? I copied the order number and order date code from invoice.tpl, but its not working. Please help. Here is the code in header.tpl: <tr> <td style="font-size: 14pt; color: #9E9F9E"> {$order->getUniqReference()}</td> </tr> Link to comment Share on other sites More sharing options...
neetupahwa Posted November 10, 2013 Author Share Posted November 10, 2013 Can someone please reply? Any help will be greatly appreciated. Link to comment Share on other sites More sharing options...
neetupahwa Posted November 12, 2013 Author Share Posted November 12, 2013 (edited) Thanks eleazar for helping me, but it is still not working. When I add {$order->getUniqReference()} to the header.php, the invoice does not open up in pdf, instead it displays only invoice date and invoice number in new browser window and everything is blank under that. When I tried running it only with the {$order->date_add|date_format:"%Y-%m-%d %H:%M"}, it opens up pdf, but does not displays order number; other invoice information (billing address, invoice items etc) are visible. Here is the code (header.tpl): <table style="width: 100%"> <tr> <td style="width: 50%"> {if $logo_path} <img src="#" width="150px" /> {/if} </td> <td style="width: 50%; text-align: right;"> <table style="width: 100%"> <tr> <td style="font-size: 14pt; color: #9E9F9E;">Date: {$date|escape:'htmlall':'UTF-8'}</td> </tr> <tr> <td style="font-size: 14pt; color: #9E9F9E">{$title|escape:'htmlall':'UTF-8'}</td> </tr> <tr> <td style="font-weight: bold; font-size: 14pt; color: #444; width: 100%">Order Number: {$order->getUniqReference()}</td> </tr> <tr> <td style="font-weight: bold; font-size: 14pt; color: #444; width: 100%">Order Date: {$order->date_add|date_format:"%Y-%m-%d %H:%M"}</td> </tr> </table> </td> </tr> </table> Following is the output of the above code, which is displayed in browser window not pdf; it doesn't displays other invoice information as well. Please help. Date: 28-09-2013 Invoice #000003 Order Number: Edited November 12, 2013 by neetupahwa (see edit history) Link to comment Share on other sites More sharing options...
neetupahwa Posted November 12, 2013 Author Share Posted November 12, 2013 Thanks eleazar. Its working now . One more question, How can I change the font of the invoice to century gothic? Link to comment Share on other sites More sharing options...
tuk66 Posted November 13, 2013 Share Posted November 13, 2013 There are DEFAULT_FONT and $font_by_lang settings in the /classes/pdf/PDFGenerator.php file. Try to use centurygothic there. Link to comment Share on other sites More sharing options...
neetupahwa Posted November 14, 2013 Author Share Posted November 14, 2013 There are DEFAULT_FONT and $font_by_lang settings in the /classes/pdf/PDFGenerator.php file. Try to use centurygothic there. Changed the font in PDFGenerator.php, but it displays error. const DEFAULT_FONT = 'centurygothic'; Error: TCPDF ERROR: Could not include font definition file: centurygothic Do I need to add the font somewhere before using it? Link to comment Share on other sites More sharing options...
tuk66 Posted November 14, 2013 Share Posted November 14, 2013 From the /tools/tcpdf/tcpdf.php file: * It is necessary to generate a font definition file first (read /fonts/utils/README.TXT).* The definition file (and the font file itself when embedding) must be present either in the current directory or in the one indicated by K_PATH_FONTS if the constant is defined. If it could not be found, the error "Could not include font definition file" is generated. Link to comment Share on other sites More sharing options...
Housy Posted November 14, 2013 Share Posted November 14, 2013 (edited) Hi tuk66 Could you please explain a little bit easier and a a bit more detailed? I don't have utils directory, so i can't read readme.txt file. I just don't understand what to do to be honest I'm using PS 1.5.4.1 and i'd like to add a custom font too. How do i generate it? Through the backoffice? Where exactly should i put my custom font files? Regards, Housy From the /tools/tcpdf/tcpdf.php file: * It is necessary to generate a font definition file first (read /fonts/utils/README.TXT).* The definition file (and the font file itself when embedding) must be present either in the current directory or in the one indicated by K_PATH_FONTS if the constant is defined. If it could not be found, the error "Could not include font definition file" is generated. Edited November 14, 2013 by Housy (see edit history) Link to comment Share on other sites More sharing options...
tuk66 Posted November 15, 2013 Share Posted November 15, 2013 These two sentences are from the tcpdf.php file. The README.TXT file is probably only in full TCPDF package, not included in the /tools/tcpdf folder in PrestaShop. It was just hints. TCPDF is not in my scope. In general, you should have a definition and fonts. Some other hints should be in this forum or on the web. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now