Prestashop 1.5.x PDF Templates Aanpassen

Hierbij de gegevens om de templates van 1.5.x aan te passen.

Maak een back-up van /pdf/invoice.tpl wn /pdf/header.tpl

Open nu invoice.tpl en plak deze inhoud erin

{*
* 2007-2012 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* 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.
*
*  @author PrestaShop SA <contact@prestashop.com>
*  @copyright  2007-2012 PrestaShop SA
*  @version  Release: $Revision: 6753 $
*  @license    http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
*  International Registered Trademark & Property of PrestaShop SA
*}
<div style="font-size: 7pt; color: #444">

<table width="100%">
<tr>
<!-- LOGO -->
<td style="width: 35%">

{if $logo_path}
<img src="{$logo_path}"/>
{/if}
</td>
<!-- END LOGO -->
<td style="width: 25%">
&nbsp;
</td>
<!-- INVOICE DETAILS -->
<td style="width: 40%" align="right">
<table style="width: 100%">
<tr>
<td style="width: 50%; text-align: right">
{l s='Order Date:' pdf='true'} :
</td>
<td style="text-align: left">
{$order->date_add|date_format:"%d-%m-%Y %H:%M"}
</td>
</tr>
<tr>
<td style="width: 50%; text-align: right">
Fakturanummer :
</td>
<td style="text-align: left">
{$title|replace:'Faktura #':'':'htmlall':'UTF-8'}
</td>
</tr>
<tr>
<td style="width: 50%; text-align: right">
{l s='Order Number:' pdf='true'} :
</td>
<td style="text-align: left">
{$order->getUniqReference()}
</td>
</tr>
<tr>
<td style="width: 50%; text-align: right">
S&aelig;lger :
</td>
<td style="text-align: left">
Online
</td>
</tr>
<tr>
<td style="width: 50%; text-align: right">
{l s='Payment Method:' pdf='true'} :
</td>
<td style="text-align: left">
<table style="width: 100%;">
{foreach from=$order_invoice->getOrderPaymentCollection() item=payment}
<tr>
<td>
{$payment->payment_method}
</td>
</tr>
{foreachelse}
<tr>
<td>
{l s='No payment' pdf='true'}
</td>
</tr>
{/foreach}
</table>
</td>
</tr>
</table>
</td>
<!-- INVOICE DETAILS END -->
</tr>
</table>
<p>&nbsp;</p>
<!-- ADDRESSES -->
<table style="width: 100%">
<tr>
<td>
{if !empty($delivery_address)}
<table style="width: 100%;">
<tr>
<td style="width: 15%"></td>
<td style="width: 35%; font-size: 6pt"><b>{l s='Delivery Address' pdf='true'} :</b><br /><br />
{$delivery_address}
</td>
<td style="width: 35%; font-size: 6pt"><b>{l s='Billing Address' pdf='true'} :</b><br /><br />
{$invoice_address}
</td>
<td style="width: 15%"></td>
</tr>
</table>
{else}
<table style="width: 100%">
<tr>
<td style="width: 15%"></td>
<td style="width: 35%"><b>{l s='Billing & Delivery Address.' pdf='true'}</b><br /><br />
{$invoice_address}
</td>
<td style="width: 35%">&nbsp;</td>
<td style="width: 15%"></td>
</tr>
</table>
{/if}
</td>
</tr>
</table>
<!-- / ADDRESSES -->
<div style="line-height: 1pt">&nbsp;</div>

<!-- PRODUCTS TAB -->
<table style="width: 100%">
<tr>
<td style="text-align: right">

<br />
<br />
<br />
<table style="width: 100%" cellspacing="2">
<tr style="line-height:4px;">
<td style="text-align: left; width: 10%; font-weight: bold">Nummer</td>
<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};">
<td  style="text-align: left; width: 10%;">{$order_detail.product_ean13}</td>
<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>

Sla deze op en upload hem naar de webshop.

Open nu de header.tpl en plak dit erin:

{*
* 2007-2012 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* 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.
*
*  @author PrestaShop SA <contact@prestashop.com>
*  @copyright  2007-2012 PrestaShop SA
*  @version  Release: $Revision: 6753 $
*  @license    http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
*  International Registered Trademark & Property of PrestaShop SA
*}

het ziet er nu al een stuk beter uit. Verder aanpassen kun je hierop zelf.

Link: http://www.prestashop.com/forums/topic/213664-guide-modifying-prestashop-15-invoice-template/

http://www.presta-addons.com/

http://www.presta-addons.com/modules/3-pdf-extensions.html