Vote to Improve PrestaShop

PrestaShop Forum: Build a free online shop. Count on the Community!

The best place in the world to ask questions about PrestaShop and get advice from our passionate community!

PrestaShop Forum: Build a free online shop. Count on the Community!

Jump to content

 
Photo

[Guide] Modifying Prestashop 1.5 Invoice Template.

modify invoice invoice template invoice theme 1.5 Invoice

  • Please log in to reply
199 replies to this topic
Supremacy2k

    PrestaShop Apprentice

  • Members
  • PipPip
  • 116 posts

Posted 02 January 2013 - 02:35 PM

*
POPULAR

Greetings and Welcome to my first Guide.

Today we're going over how to modify the look of the Invoices generated by Prestashop 1.5 used in the DEFAULT theme. (If you use a custom theme, check your themes/your_theme_name/ folder and check if there is a pdf folder inside, with *.tpl files. If so, modify those files, if not follow my steps below)

First of all, feel free to translate this guide, and post it in your languages community.

Before we proceed I have to notify you about the Disclaimer by PrestaShop which states:

* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
What that means, is that ALL changes made are LOST if you choose to upgrade your shop in the future.


Notice: This Guide focuses on the Invoice template, and NOT Invoice-b2b template.
(i don't use B2B invoices in my shop)


Notice: If you use multi language in your shop, skip steps which states "Plain Text" as it doesn't change with the selected language.


TABLE OF CONTENT :
  • Preparing and Requirements.
  • Goal and Example.
    2.1. Explanation.

  • Getting Started - Preparing files for modification.
  • Creating the Header of the invoice.
    4.1. Inserting the Logo and making a gab between Logo and Right Column.
    4.2. Making the Right Column, for the Invoice Details.

  • Inserting the Billing and Delivery addresses.
  • Creating the products list.
  • Creating rest of the file.
  • Disclaimer and other info.

1. Preparing and Requirements.

What is required to follow this guide:
  • Basic programming skills. (HTML / CSS / PHP - Otherwise, Google is your friend.)
    I will NOT explain every programming tag used in this guide, only the highlights.
  • Backup backup backup.. i can NOT stress this enough!
What you need:
  • Patience. (All good things takes time.)
  • Lots of coffee.
  • An order in your shop, to test the invoice template changes.
What files are modified:
  • header.tpl (referred to as header in this guide)
  • invoice.tpl (referred to as invoice in this guide)
Layout of this Guide:
  • Line numbers: Are there to help me explain key elements of this guide.
    Remember to remove them!
    Yes i know they are annoying to remove, but i NEED them!
  • Notices: Are in place for additional information regarding the layout.
Again these files are found in /pdf/ in the root of your shop, OR under the theme you use. (/themes/your_theme/pdf/)

By following this guide, you can modify the template to any look you desire.

2. Goal and Example.

Here is an example of what we're going for. (Example is in Danish, i will explain below the picture, and the bottom of the invoice is cut off, no need for lots of white color and 1 line of company information here)
Posted Image

2.1 Explanation.

To the right of the logo is the following fields, from the top. ( ) explains where it was before.
  • Order Date. (Left of the products) (Format: Day-Month-Year Hours:Minutes)
  • Invoice Number. (Top right)
  • Order Number. (Left of the products)
  • Salesman. (Not on the invoice at all)
  • Payment Method. (Left of the products along with the amount)
Right below logo, above the products, we find the following:
  • Billing address
  • Delivery address.
(The example uses same billing and delivery address)
Nothing is changed there, except I moved it to the center.

Next the products list/fields are as following.
  • Product Number/ID. (The field EAN13 when creating the product in BackOffice)
  • Product/Reference.
  • Unit price w/o tax.
  • Unit price w/ tax.
  • Discount. (Only shown if a discount is given, in the example, no discount is given)
  • Number.
  • Total price w/ tax.
The rest is pretty much standard.


Notice: All colors, text size etc. is set within the invoice file.


3. Getting Started - Preparing files for modification.

I will only remind you of this 1 more time... BACKUP your files!

First open up your header and delete everything below line 26.
(the reason for this, is that the header file, don't have access to all required fields we want right of the logo)
This includes:
  • Complete order date (it only have access to the day of purchase, not the time)
  • Order number.
  • Payment Method.
Save the file.
Next open up invoice.

Find line 27 and delete EVERYTHING below it. (yes there are 307 lines in this file.)

On line 26, i chose to decrease the text size by 1pt.
01. <div style="font-size: 8pt; color: #444">
Change to
01. <div style="font-size: 7pt; color: #444">


Notice: The color: #444" is the color of the text in the invoice.


4. Creating the Header of the invoice.
4.1 Creating the Logo and the gab between Logo and Right Column.

Next we will create the table that holds the entire invoice content:

On line 28 insert the following:
01 <table width="100%">
02 <tr>
03 <!-- LOGO -->
04  <td style="width: 35%">  
05		   {if $logo_path}
06			   <img src="{$logo_path}"/>
07		{/if}
08  </td>
09  <!-- END LOGO -->
10  <td style="width: 25%">
11   &nbsp;
12  </td>
13  <td style="width: 40%" align="right">

What we just did here, was the following:
  • Line 01 - Created a table with the maximum allowed width within the invoice.
  • Line 04 - Created a left column for the logo with a width of 35%.
  • Line 06 - Inserted our logo.
  • Line 10 - Created a center column that serves as a space between the logo and the right column with a width of 25%
  • Line 13 - Created a right column with a width of 40% that holds the right invoice details.
Notice: If your logo is too big for the left column with a width of 35%, you can adjust this by increasing the left column width, and decreasing the center column width to make it fit.

4.2 Creating the Right Column, for the Invoice Details.

Next we have to create a new table in the right column to house our invoice details.

This is done by inserting the following code on line 41:
01 <!-- INVOICE DETAILS -->
02		<table style="width: 100%">
03			<tr>
04			 <td style="width: 50%; text-align: right">
05			  {l s='Order Date:' pdf='true'} :
06			 </td>
07			 <td style="text-align: left">
08			  {$order->date_add|date_format:"%d-%m-%Y %H:%M"}
09			 </td>
10			</tr>
11			<tr>
12			 <td style="width: 50%; text-align: right">			  
13			  Fakturanummer :
14			 </td>
15			 <td style="text-align: left">
16			   {$title|replace:'Faktura #':'':'htmlall':'UTF-8'}
17			 </td>
18			</tr>
19			<tr>
20			 <td style="width: 50%; text-align: right">
21			  {l s='Order Number:' pdf='true'} :
22			 </td>
23			 <td style="text-align: left">
24			  {$order->getUniqReference()}
25			 </td>
26			</tr>
27			<tr>
28			 <td style="width: 50%; text-align: right">
29			  S&aelig;lger :
30			 </td>
31			 <td style="text-align: left">
32			  Online
33			 </td>
34			</tr>
35			<tr>
36			 <td style="width: 50%; text-align: right">
37			  {l s='Payment Method:' pdf='true'} :
38			 </td>
39			 <td style="text-align: left">
40			  <table style="width: 100%;">
41						  {foreach from=$order_invoice->getOrderPaymentCollection() item=payment}
42							  <tr>
43								  <td>
44								   {$payment->payment_method}
45								  </td>
46							  </tr>
47						  {foreachelse}
48							  <tr>
49								  <td>
50								   {l s='No payment' pdf='true'}
51								  </td>
52							  </tr>
53						  {/foreach}
54			</table>
55	   		</td>
56	   	   </tr>
57		</table>
58  </td>
59  <!-- INVOICE DETAILS END -->

A lot of code, i know.

We just created the entire right column and all required fields.
Below is the highlights of the code:
  • Line 02 - We created the needed table for the invoice details, at 100% width of the right column, which is 40% of the invoice width.
  • Line 05 - Order Date text. Changes with language.
  • Line 08 - The actual date, time format is: day-month-year hours:minutes.
  • Line 13 - Invoice number text. Plain text, correct this to match your current language.
  • Line 16 - The actual invoice.
  • The "replace:'Faktura #' part, strips away the text before the invoice number. (Change Faktura to match your language)
    I was pretty tired of looking at the #.
  • Line 21 - Order number text. Changes with language.
  • Line 24 - The actual order number.
  • Line 29 - Salesman text. Plain text, correct this to match your current language.
  • Line 32 - Online. This is a webshop, it's sold online, lets tell the customer that.
  • Line 37 - Payment Method text. Changes with language.
  • Line 40 - 54 - PrestaShop's code for determine payment method, DO NOT ALTER THIS!
  • End the table of the header, and make a space between the logo and billing/delivery address(es)

Insert the following on line 100:
   </td>
  </tr>
</tbody></table>
<p> </p>

5. Inserting the Billing and Delivery addresses.

Next we need a new table to house the address/delivery address(es).
Insert the following code on line 103:
01 <!-- ADDRESSES -->
02 <table style="width: 100%">
03  <tr>
04   <td>
05	{if !empty($delivery_address)}
06	 <table style="width: 100%;">
07	  <tr>
08	   <td style="width: 15%"></td>
09	   <td style="width: 35%; font-size: 6pt"><b>{l s='Delivery Address' pdf='true'} :</b><br /><br />
10		{$delivery_address}
11	   </td>
12	   <td style="width: 35%; font-size: 6pt"><b>{l s='Billing Address' pdf='true'} :</b><br /><br />
13		{$invoice_address}
14	   </td>
15	   <td style="width: 15%"></td>
16	  </tr>
17	 </table>
18	{else}
19	 <table style="width: 100%">
20	  <tr>
21	   <td style="width: 15%"></td>
22	   <td style="width: 35%"><b>{l s='Billing & Delivery Address.' pdf='true'}</b><br /><br />
23		{$invoice_address}
24		</td>
25		<td style="width: 35%">&nbsp;</td>
26		<td style="width: 15%"></td>
27	   </tr>
28	  </table>
29	 {/if}
30	</td>
31   </tr>
32 </table>
33 <!-- / ADDRESSES -->

The following code creates a table to house the addresses, with a 15% space on each side. (Left and Right)
You should have no need to change anything here, unless you think the space on the left and right are too much, you can than on line 08+15+21+26 decrease the 15% and on line 09+12+22+25 increase the 35% corresponding to the 15%

Insert the following code on line 136, to create a gab between the addresses and the product listings.
<div style="line-height: 1pt"> </div>

6. Creating the products list.

Next is the products tab, which shows all bought items and related information.
This part will be explained in sections, as it is 183 lines of code.
Most of the code i will jump over quite quickly as it is standard code, and no changes has been made.

Start by inserting the following code on line 138:
<!-- PRODUCTS TAB -->
<table style="width: 100%">
<tbody><tr>
  <td style="text-align: right">
This code starts the table for the products.

Insert the following code on line 148 :
<td style="text-align: left; width: 10%; font-weight: bold">Nummer</td>
This line inserts the Product ID text, this text will not change with language, change it to your current language.

Insert this next chunk of code on line 149:
			   	 <td style="text-align: left; width: 45%; font-weight: bold">{l s='Product / Reference' pdf='true'}</td>
					<!-- unit price tax excluded is mandatory -->
					{if !$tax_excluded_display}
						<td style="text-align: right; width: 12%; font-weight: bold">{l s='Unit Price' pdf='true'} {l s='(Tax Excl.)' pdf='true'}</td>
					{/if}
					<td style="text-align: right; width: 12%; font-weight: bold">
						{l s='Unit Price' pdf='true'}
						{if $tax_excluded_display}
							 {l s='(Tax Excl.)' pdf='true'}
						{else}
							 {l s='(Tax Incl.)' pdf='true'}
						{/if}
					</td>
					<td style="text-align: right;width: 6%; font-weight: bold">{l s='Qty' pdf='true'}</td>
					<td style="text-align: right;width: 15%; font-weight: bold">
						{l s='Total' pdf='true'}
						{if $tax_excluded_display}
							{l s='(Tax Excl.)' pdf='true'}
						{else}
							{l s='(Tax Incl.)' pdf='true'}
						{/if}
					</td>
				</tr>
				<!-- PRODUCTS -->
				{foreach $order_details as $order_detail}
				{cycle values='#FFF,#DDD' assign=bgcolor}
				<tr style="line-height:4px;background-color:{$bgcolor};">
The code for the rest of the products text, product name, taxes, units and so on.

Notice: values='#FFF,#DDD' cycles the background color of the products, from white to gray.


Remember we created a field for the product number/ID ?
It's time to get the actual product number/ID inserted in front of the product name.

Insert the following on line 176:
<td  style="text-align: left; width: 10%;">{$order_detail.product_ean13}</td>
This inserts the EAN13 number used in BackOffice to your Invoice template, so the customer can quickly look up the same product in your shop, by searching for the EAN13 number.

7. Creating rest of the file.

The rest of the code is unchanged, so i will not annoy you by inserting line numbers on the following 178 lines of code.

Insert the following code on line 177:
					 <td style="text-align: left; width: 45%">{$order_detail.product_name}</td>
					<!-- unit price tax excluded is mandatory -->
					{if !$tax_excluded_display}
						<td style="text-align: right; width: 12%">
						{displayPrice currency=$order->id_currency price=$order_detail.unit_price_tax_excl}
						</td>
					{/if}
					<td style="text-align: right; width: 12%">
					{if $tax_excluded_display}
						{displayPrice currency=$order->id_currency price=$order_detail.unit_price_tax_excl}
					{else}
						{displayPrice currency=$order->id_currency price=$order_detail.unit_price_tax_incl}
					{/if}
					</td>
					<td style="text-align: right; width: 6%">{$order_detail.product_quantity}</td>
					<td style="width: 15%; text-align: right;  width: 15%">
					{if $tax_excluded_display}
						{displayPrice currency=$order->id_currency price=$order_detail.total_price_tax_excl}
					{else}
						{displayPrice currency=$order->id_currency price=$order_detail.total_price_tax_incl}
					{/if}
					</td>
				</tr>
					{foreach $order_detail.customizedDatas as $customizationPerAddress}
						{foreach $customizationPerAddress as $customizationId => $customization}
							<tr style="line-height:4px;background-color:{$bgcolor}; ">
								<td style="line-height:3px; text-align: left; width: 60%; vertical-align: top">

										<blockquote>
											{if isset($customization.datas[$smarty.const._CUSTOMIZE_TEXTFIELD_]) && count($customization.datas[$smarty.const._CUSTOMIZE_TEXTFIELD_]) > 0}
												{foreach $customization.datas[$smarty.const._CUSTOMIZE_TEXTFIELD_] as $customization_infos}
													{$customization_infos.name}: {$customization_infos.value}
													{if !$smarty.foreach.custo_foreach.last}<br />
													{else}
													<div style="line-height:0.4pt">&nbsp;</div>
													{/if}
												{/foreach}
											{/if}

											{if isset($customization.datas[$smarty.const._CUSTOMIZE_FILE_]) && count($customization.datas[$smarty.const._CUSTOMIZE_FILE_]) > 0}
												{count($customization.datas[$smarty.const._CUSTOMIZE_FILE_])} {l s='image(s)' pdf='true'}
											{/if}
										</blockquote>
								</td>
								<td style="text-align: right; width: 15%"></td>
								<td style="text-align: center; width: 10%; vertical-align: top">({$customization.quantity})</td>
								<td style="width: 15%; text-align: right;"></td>
							</tr>
						{/foreach}
					{/foreach}
				{/foreach}
				<!-- END PRODUCTS -->

				<!-- CART RULES -->
				{assign var="shipping_discount_tax_incl" value="0"}
				{foreach $cart_rules as $cart_rule}
				{cycle values='#FFF,#DDD' assign=bgcolor}
					<tr style="line-height:4px;background-color:{$bgcolor};" text-align="left">
						<!-- <td colspan="{if !$tax_excluded_display}5{else}4{/if}">{$cart_rule.name}</td> -->
						<td></td><td colspan="3">{$cart_rule.name}</td><td style="text-align: right">1</td>
						<td>
							{if $cart_rule.free_shipping}
								{assign var="shipping_discount_tax_incl" value=$order_invoice->total_shipping_tax_incl}
							{/if}
							{if $tax_excluded_display}
								- {$cart_rule.value_tax_excl}
							{else}
								- {$cart_rule.value}
							{/if}
						</td>
					</tr>
				{/foreach}
				<!-- END CART RULES -->
			</table>

			<table style="width: 100%">
				{if (($order_invoice->total_paid_tax_incl - $order_invoice->total_paid_tax_excl) > 0)}
				<tr style="line-height:5px;">
					<td style="width: 85%; text-align: right; font-weight: bold">{l s='Product Total (Tax Excl.)' pdf='true'} :</td>
					<td style="width: 15%; text-align: right;">{displayPrice currency=$order->id_currency price=$order_invoice->total_products}</td>
				</tr>

				<tr style="line-height:5px;">
					<td style="width: 85%; text-align: right; font-weight: bold">{l s='Product Total (Tax Incl.)' pdf='true'} :</td>
					<td style="width: 15%; text-align: right;">{displayPrice currency=$order->id_currency price=$order_invoice->total_products_wt}</td>
				</tr>
				{else}
				<tr style="line-height:5px;">
					<td style="width: 85%; text-align: right; font-weight: bold">{l s='Product Total' pdf='true'} :</td>
					<td style="width: 15%; text-align: right;">{displayPrice currency=$order->id_currency price=$order_invoice->total_products}</td>
				</tr>
				{/if}

				{if $order_invoice->total_discount_tax_incl > 0}
				<tr style="line-height:5px;">
					<td style="text-align: right; font-weight: bold">{l s='Total Vouchers' pdf='true'} :</td>
					<td style="width: 15%; text-align: right;">-{displayPrice currency=$order->id_currency price=($order_invoice->total_discount_tax_incl + $shipping_discount_tax_incl)}</td>
				</tr>
				{/if}

				{if $order_invoice->total_wrapping_tax_incl > 0}
				<tr style="line-height:5px;">
					<td style="text-align: right; font-weight: bold">{l s='Wrapping Cost' pdf='true'} :</td>
					<td style="width: 15%; text-align: right;">
					{if $tax_excluded_display}
						{displayPrice currency=$order->id_currency price=$order_invoice->total_wrapping_tax_excl}
					{else}
						{displayPrice currency=$order->id_currency price=$order_invoice->total_wrapping_tax_incl}
					{/if}
					</td>
				</tr>
				{/if}

				{if $order_invoice->total_shipping_tax_incl > 0}
				<tr style="line-height:5px;">
					<td style="text-align: right; font-weight: bold">{l s='Shipping Cost' pdf='true'} :</td>
					<td style="width: 15%; text-align: right;">
						{if $tax_excluded_display}
							{displayPrice currency=$order->id_currency price=$order_invoice->total_shipping_tax_excl}
							{else}
							{displayPrice currency=$order->id_currency price=$order_invoice->total_shipping_tax_incl}
						{/if}
					</td>
				</tr>
				{/if}

				{if ($order_invoice->total_paid_tax_incl - $order_invoice->total_paid_tax_excl) > 0}
				<tr style="line-height:5px;">
					<td style="text-align: right; font-weight: bold">{l s='Total Tax' pdf='true'} :</td>
					<td style="width: 15%; text-align: right;">{displayPrice currency=$order->id_currency price=($order_invoice->total_paid_tax_incl - $order_invoice->total_paid_tax_excl)}</td>
				</tr>
				{/if}

				<tr style="line-height:5px;">
					<td style="text-align: right; font-weight: bold">{l s='Total' pdf='true'} :</td>
					<td style="width: 15%; text-align: right;">{displayPrice currency=$order->id_currency price=$order_invoice->total_paid_tax_incl}</td>
				</tr>

			</table>

		</td>
	</tr>
</table>
<!-- / PRODUCTS TAB -->

<div style="line-height: 1pt">&nbsp;</div>

{$tax_tab}

{if isset($order_invoice->note) && $order_invoice->note}
<div style="line-height: 1pt">&nbsp;</div>
<table style="width: 100%">
	<tr>
		<td style="width: 15%"></td>
		<td style="width: 85%">{$order_invoice->note|nl2br}</td>
	</tr>
</table>
{/if}

{if isset($HOOK_DISPLAY_PDF)}
<div style="line-height: 1pt">&nbsp;</div>
<table style="width: 100%">
	<tr>
		<td style="width: 15%"></td>
		<td style="width: 85%">{$HOOK_DISPLAY_PDF}</td>
	</tr>
</table>
{/if}

<table style="width: 100%;">
<tr>
  <td style="width: 17%"></td>
   <td style="width: 66%">{if $available_in_your_account}{l s='An electronic version of this invoice is available in your account. To access it, log in to our website using your e-mail address and password (which you created when placing your first order).' pdf='true'}{/if}</td>
  </td style="width: 17%"></td>
</tr>
</table>			

</div>

8. Disclaimer and other info.

First off, thanks for reading this guide, I really hope you enjoyed it, and it was useful to you.
It took me close to 4 hours writing it.

Now the serious part.
I will not be held responsible if you mess up your files, or other wise breake your webshop.
This guide is only used as an example on how you can modify your invoice template, to fit your needs.

I will not be held responsible for typos, errors in the code (it does however work on my shop), and other funny things that might have snuck in, during writing this.
I only had between 1.5 and 2 hours of sleep, and WAY to much coffee writing this.

Critcism, ideas and other such replies are welcome.

To quote Wikipedia.

A critic is anyone who expresses a value judgment. Informally, criticism is a common aspect of all human expression and need not necessarily imply skilled or accurate expressions of judgment. Critical judgments, good or bad, may be positive (in praise of an object of attention), negative (in dispraise), or balanced (weighing a combination of factors both for and against). Since all criticism must be regarded as having a purpose, a critic may also be definable by his or her specific motivation. At its simplest, and for whatever reason, a critic may have either constructive or destructive intent.

</div>

Ps. If anybody know how to make Anchors in this forum, so i can link my Table of Content, please sent me a private message on how to do that, to keep this topic free of non-related posts.

Best Regards
- Kris.

Edit: Attached files, remember to rename them to .tpl

Attached Files


Edited by Supremacy2k, 04 January 2013 - 10:43 AM.


anderskiel

    PrestaShop Newbie

  • Members
  • Pip
  • 10 posts

Posted 04 January 2013 - 10:22 AM

Very comprehensive guide Kris. Thanks!

For those of us who are strugling with patience and skills would you be so kind to share your edited files?

Thanks

Anders

Supremacy2k

    PrestaShop Apprentice

  • Members
  • PipPip
  • 116 posts

Posted 04 January 2013 - 10:44 AM

2 files are attached in first post.

header.txt and invoice.txt

Files should be renamed to header.tpl and invoice.tpl

anderskiel

    PrestaShop Newbie

  • Members
  • Pip
  • 10 posts

Posted 04 January 2013 - 01:22 PM

Super thank you. I now have a very nice looking invoice :-)

However i have a bit too much space above the logo. How do i decrease this?

Thanks.

Anders

XtreM726

    PrestaShop Apprentice

  • Members
  • PipPip
  • 83 posts

Posted 04 January 2013 - 04:41 PM

where is footer.tpl files ?
www.snkrs.co - www.sneakers.web.id

Supremacy2k

    PrestaShop Apprentice

  • Members
  • PipPip
  • 116 posts

Posted 04 January 2013 - 07:08 PM

Footer files are not altered. You can find them in your PDF folder.

In the top of this guide is a list of files that is subject to changes. :-)

Jamshaid Hashmi

    PrestaShop Newbie

  • Members
  • Pip
  • 10 posts

Posted 06 January 2013 - 07:35 AM

how can I change {$invoice_address} and {$delivery_address} format.


Company name (bold) or font size 18
firstname lastname (small)
address1, address2
city, country

actually I need this format on every document

Edited by Jamshaid Hashmi, 06 January 2013 - 07:35 AM.


m3442a

    PrestaShop Apprentice

  • Members
  • PipPip
  • 70 posts

Posted 06 January 2013 - 06:07 PM

After copy the code in my invoice.tpl i became this error:

Warning: Division by zero in /www/htdocs/....../....../....../....../tools/tcpdf/tcpdf.php on line 23203

Warning: array_fill() [function.array-fill]: Number of elements must be positive in /www/htdocs/....../....../....../....../tools/tcpdf/tcpdf.phpon line 23205

Warning: Invalid argument supplied for foreach() in /www/htdocs/....../....../....../....../tools/tcpdf/tcpdf.php on line 24618

Warning: Invalid argument supplied for foreach() in /www/htdocs/....../....../....../....../tools/tcpdf/tcpdf.php on line 24650
TCPDF ERROR: Some data has already been output, can't send PDF file

Edited by m3442a, 06 January 2013 - 07:20 PM.


Supremacy2k

    PrestaShop Apprentice

  • Members
  • PipPip
  • 116 posts

Posted 06 January 2013 - 09:08 PM

This guide is for prestashop version 1.5, not 1.4

I can't help you with your error. :-(

m3442a

    PrestaShop Apprentice

  • Members
  • PipPip
  • 70 posts

Posted 06 January 2013 - 09:58 PM

I have PS Version 1.5.2. Maybe is an error in your code? The template is very nice, thanks for that, but dont working :(

Supremacy2k

    PrestaShop Apprentice

  • Members
  • PipPip
  • 116 posts

Posted 06 January 2013 - 10:24 PM

Well then its at 1.4 upgraded to 1.5, because 1.5 do not have a "tools" folder.

And in that case I'm not sure what your problem is, because I'm not getting any errors on my shop, which is live. :/

Edit: I can see you get your error in the .php file, and not the tpl file.

Edited by Supremacy2k, 07 January 2013 - 03:04 AM.


bellini13

    PrestaShop Fanatic

  • Members
  • PipPipPipPip
  • 3951 posts

Posted 07 January 2013 - 02:03 PM

very nice guide, thanks for sharing!

v1.5 does indeed include a tools folder, which is where all the plugins and 3rd party libraries are stored. The error is occuring in the writeHTML function of tcpdf.php. Most likely something in the invoice.tpl is not correct or conflicting with the users specific installation. It would need to be debugged further to understand the problem.
Posted Image

Supremacy2k

    PrestaShop Apprentice

  • Members
  • PipPip
  • 116 posts

Posted 07 January 2013 - 06:45 PM

Okey I'm blind.
I totally missed the "tools" folder, hehe.

Anyways.

On line 23.203 i have the following:
} else {
on 23.205 i have this:
}
On 24.618 this:
$this->y += $this->getHTMLUnitToUnits($table_el['attribute']['cellspacing'], 1, 'px');
and on 24.650 this
if (isset($this->theadMargins['top'])) {

m3442a .. can you post your lines from 24203 to 24205 and from 24618 to 24650 ?

Supremacy2k

    PrestaShop Apprentice

  • Members
  • PipPip
  • 116 posts

Posted 07 January 2013 - 06:47 PM

how can I change {$invoice_address} and {$delivery_address} format.


Company name (bold) or font size 18
firstname lastname (small)
address1, address2
city, country

actually I need this format on every document


To be honest I'm not quite sure where address text is generated.
I havent looked into it, and might go beyond my skills for now. :(

Woutermesker

    PrestaShop Apprentice

  • Members
  • PipPip
  • 46 posts

Posted 09 January 2013 - 12:09 AM

Hi,

I used a little info from this topic, attached my result.

Wouter

Attached Files


Edited by Woutermesker, 09 January 2013 - 12:09 AM.


Supremacy2k

    PrestaShop Apprentice

  • Members
  • PipPip
  • 116 posts

Posted 09 January 2013 - 04:26 AM

Looks good. :)

But you should try remove the Faktura # text in your header, so it's just Faktura: NL00001 or whatever. :)

troyrob

    PrestaShop Apprentice

  • Members
  • PipPip
  • 93 posts

Posted 10 January 2013 - 12:41 PM

Hello question?

How would i insert Product reference number instead of EAN number instead?

Supremacy2k

    PrestaShop Apprentice

  • Members
  • PipPip
  • 116 posts

Posted 10 January 2013 - 02:22 PM

on line 176 :
<td  style="text-align: left; width: 10%;">{$order_detail.product_ean13}</td>

insert :
<td  style="text-align: left; width: 10%;">{$order_detail.product_reference}</td>

should do it. :)

alda81

    PrestaShop Newbie

  • Members
  • Pip
  • 2 posts

Posted 12 January 2013 - 08:13 PM

thanks Supremacy2k for your guide

Hi,

I used a little info from this topic, attached my result.

Wouter

hi, do you think that you can post your files with adaptation? thank you

mishamean

    PrestaShop Newbie

  • Members
  • Pip
  • 3 posts

Posted 26 January 2013 - 11:11 AM

Hi,

I made some alterations to my invoice also. But at the reference number/order number I can't make that show.
I tried inseting
{$order_detail.product_reference}
but on the PDF I see only a blank space and then I looked at your guide and tried with
{$order_detail.product_ean13}
.

The result is the same. I don't understand what I did wrong with the invoice template because all the other cells and data in them are shown properly.

Can anybody give me some pointers to what should I try next?

Thanks





2 user(s) are reading this topic

2 members, 0 guests, 0 anonymous users