troyrob Posted October 16, 2012 Share Posted October 16, 2012 Hey guys, just installed Prestashop 1.5.1 and have run into a minor snag. The PDF invoices don't have the product reference number, and i have no idea how to add it. Has anyone done this already? Link to comment Share on other sites More sharing options...
todaytonight Posted December 4, 2012 Share Posted December 4, 2012 Hi troyrob, I am just wondering have you found a solution yet? I really want to have ref number in invioce as well. Thanks Link to comment Share on other sites More sharing options...
tuk66 Posted December 4, 2012 Share Posted December 4, 2012 The last version of M4 PDF Extensions module can print all product properties in invoice. Link to comment Share on other sites More sharing options...
guidocx84 Posted December 6, 2012 Share Posted December 6, 2012 The only solution is to buy a 99 €module??? Don't think that... We only need to add the reference number near the product name... I see that in /pdf/invoice.tpl at row 129 there is <td style="text-align: left; width: 45%">{$order_detail.product_name}</td> Here we have to insert also the reference... but I don't know wich is the name of the variable and I don't know how to add it with smarty.... please, any help? Thank you very much! Regars. Link to comment Share on other sites More sharing options...
tuk66 Posted December 6, 2012 Share Posted December 6, 2012 The product reference number in an order detail is: {$order_detail.product_reference} 3 Link to comment Share on other sites More sharing options...
guidocx84 Posted December 6, 2012 Share Posted December 6, 2012 The product reference number in an order detail is: {$order_detail.product_reference} Yes! Solved changing row n.129 with this one: <td style="text-align: left; width: 45%">{$order_detail.product_name} / {$order_detail.reference}</td> Thanks! 5 Link to comment Share on other sites More sharing options...
mytwocentimes Posted December 6, 2012 Share Posted December 6, 2012 @tuk66 that is a cool thing you have done :-) Would there be a similar way to get the MSRP (product price *not* the unit cost) into the invoice or is that a bigger job ? Link to comment Share on other sites More sharing options...
tuk66 Posted December 6, 2012 Share Posted December 6, 2012 Try {$order_detail.product_price} or {$order_detail.original_product_price} or {$order_detail.total_price_tax_incl} or {$order_detail.total_price_tax_excl} or {$order_detail.unit_price_tax_incl} or {$order_detail.unit_price_tax_excl} Link to comment Share on other sites More sharing options...
mytwocentimes Posted December 6, 2012 Share Posted December 6, 2012 {$order_detail.product_price} {$order_detail.original_product_price} {$order_detail.total_price_tax_incl} {$order_detail.total_price_tax_excl} {$order_detail.unit_price_tax_incl} {$order_detail.unit_price_tax_excl} @tuk66 - I have tried them all - they give somehow the information available in the ps_order_detail table - these are not the product "price" field from the ps_product table. Why? Because I use that price to indicate the after-tax-suggested-retail-price, I then set specific prices for special groups (retail shops). When a shop buys something, the price that gets put into the order_detail is the specific price. Shops want to see the MSRP *and* their unit_price thanks if you can help - no worries if it is too much work Link to comment Share on other sites More sharing options...
tuk66 Posted December 6, 2012 Share Posted December 6, 2012 Honestly, I have a very little experience with PrestaShop v1.5 invoice templates system. But I have a great experience with M4 PDF Extensions module and there is possibilty to print product.price value in the last version. See changelog http://www.presta-addons.com/modules/3-pdf-extensions.html. Link to comment Share on other sites More sharing options...
mytwocentimes Posted December 6, 2012 Share Posted December 6, 2012 Honestly, I have a very little experience with PrestaShop v1.5 invoice templates system. Oh, how sad for me ... my system as follows: Server information: Linux #1 SMP Mon Aug 23 11:13:12 CEST 2010 i686 Server software version: Apache PHP version: 5.2.17 Memory limit: 128M Max execution time: 10 Database information MySQL version: 5.5.27-log MySQL engine: InnoDB Tables prefix: ps_ Store information Prestashop version: 1.5.2.0 I just tried your demo's - they have a lot of functionality - wish it were a 1.5.2 demo :-( thanks for trying to help - is there an easy way to call the data directly from the database ? Link to comment Share on other sites More sharing options...
tuk66 Posted December 6, 2012 Share Posted December 6, 2012 Currently demo for PS 1.5 is not available. The module hides differencies between 1.3, 1.4 and 1.5 versions of PrestaShop and works almost the same in all versions (missed or added features are difference only). Link to comment Share on other sites More sharing options...
maze Posted December 11, 2012 Share Posted December 11, 2012 The product reference number in an order detail is: {$order_detail.product_reference} Thank you very much! Link to comment Share on other sites More sharing options...
todaytonight Posted December 13, 2012 Share Posted December 13, 2012 Yes! Solved changing row n.129 with this one: <td style="text-align: left; width: 45%">{$order_detail.product_name} / {$order_detail.reference}</td> Thanks! Confirmed. It works very well. Thank you so much! Link to comment Share on other sites More sharing options...
nostradamus Posted December 15, 2012 Share Posted December 15, 2012 How can i get the product image to show to? i treid <td style="text-align: left; width: 45%">{$order_detail.product_img}{$order_detail.product_name} / {$order_detail.reference}</td> and <td style="text-align: left; width: 45%">{$order_detail.product_image}{$order_detail.product_name} / {$order_detail.reference}</td> Both wont work Link to comment Share on other sites More sharing options...
artofadornment Posted February 25, 2013 Share Posted February 25, 2013 Yes! Solved changing row n.129 with this one: <td style="text-align: left; width: 45%">{$order_detail.product_name} / {$order_detail.reference}</td> Thanks! Brilliant, thank you!! Worked great with PS 1.5.3.1. 1 Link to comment Share on other sites More sharing options...
deepakthakare Posted April 15, 2013 Share Posted April 15, 2013 hi How to Add product Image To PDF Invoice Prestashop 1.5 Thanks Deepak Link to comment Share on other sites More sharing options...
shiggidydog Posted August 28, 2013 Share Posted August 28, 2013 (edited) Just to summarize for everyone... since not everyone may know which template to modify, you need to go under your base root of your prestashop installation directory and there is a folder called "pdf" which has a file called "invoice.tpl" My 1.5.4 version had the following code on line 128 (yours may vary so look for this line): <td style="text-align: left; width: 45%">{$order_detail.product_name}</td> Then replace with: <td style="text-align: left; width: 45%">{$order_detail.product_name} / {$order_detail.reference}</td> On another note: I had an issue with a long invoice that would go to a second page and that caused an error in the pdf. So instead I actually changed product reference to come first then product name and i separated them out into different columns. To make life easy I'll just copy my invoice.tpl file here for you to copy into invoice.tpl. Hopefully this helps someone else. {* * 2007-2013 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 [email protected] 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 <[email protected]> * @copyright 2007-2013 PrestaShop SA * @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: 8pt; color: #444">[/color] [color="#000088"]<table> <tr><td> </td></tr> </table>[/color] [color="#000088"]<!-- ADDRESSES --> <table style="width: 100%"> <tr> <td style="width: 15%"></td> <td style="width: 85%"> {if !empty($delivery_address)} <table style="width: 100%"> <tr> <td style="width: 50%"> <span style="font-weight: bold; font-size: 10pt; color: #9E9F9E">{l s='Delivery Address' pdf='true'}</span><br /> {$delivery_address} </td> <td style="width: 50%"> <span style="font-weight: bold; font-size: 10pt; color: #9E9F9E">{l s='Billing Address' pdf='true'}</span><br /> {$invoice_address} </td> </tr> </table> {else} <table style="width: 100%"> <tr>[/color] [color="#000088"] <td style="width: 50%"> <span style="font-weight: bold; font-size: 10pt; color: #9E9F9E">{l s='Billing & Delivery Address.' pdf='true'}</span><br /> {$invoice_address} </td> <td style="width: 50%">[/color] [color="#000088"] </td> </tr> </table> {/if} </td> </tr> </table> <!-- / ADDRESSES -->[/color] [color="#000088"]<div style="line-height: 1pt"> </div>[/color] [color="#000088"]<!-- PRODUCTS TAB --> <table style="width: 100%"> <tr> <td style="width: 15%; padding-right: 7px; text-align: right; vertical-align: top; font-size: 7pt;"> <!-- CUSTOMER INFORMATION --> <b>{l s='Order Number:' pdf='true'}</b><br /> {$order->getUniqReference()}<br /> <br /> <b>{l s='Order Date:' pdf='true'}</b><br /> {dateFormat date=$order->date_add full=0}<br /> <br /> <b>{l s='Payment Method:' pdf='true'}</b><br /> <table style="width: 100%;"> {foreach from=$order_invoice->getOrderPaymentCollection() item=payment} <tr> <td style="width: 50%">{$payment->payment_method}</td> <td style="width: 50%">{displayPrice price=$payment->amount currency=$order->id_currency}</td> </tr> {foreachelse} <tr> <td>{l s='No payment' pdf='true'}</td> </tr> {/foreach} </table> <br /> <!-- / CUSTOMER INFORMATION --> </td> <td style="width: 85%; text-align: right"> <table style="width: 100%; font-size: 8pt;"> <tr style="line-height:4px;"> <td style="text-align: left; background-color: #4D4D4D; color: #FFF; padding-left: 10px; font-weight: bold; width: 15%">{l s='Reference' pdf='true'}</td> <td style="text-align: left; background-color: #4D4D4D; color: #FFF; padding-left: 10px; font-weight: bold; width: 30%">{l s='Product' pdf='true'}</td> <!-- unit price tax excluded is mandatory --> {if !$tax_excluded_display} <td style="background-color: #4D4D4D; color: #FFF; text-align: right; font-weight: bold; width: 10%">{l s='Unit Price' pdf='true'} <br />{l s='(Tax Excl.)' pdf='true'}</td> {/if} <td style="background-color: #4D4D4D; color: #FFF; text-align: right; font-weight: bold; width: 10%"> {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="background-color: #4D4D4D; color: #FFF; text-align: right; font-weight: bold; width: 10%">{l s='Discount' pdf='true'}</td> <td style="background-color: #4D4D4D; color: #FFF; text-align: center; font-weight: bold; width: 10%">{l s='Qty' pdf='true'}</td> <td style="background-color: #4D4D4D; color: #FFF; text-align: right; font-weight: bold; width: {if !$tax_excluded_display}15%{else}25%{/if}"> {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:6px;background-color:{$bgcolor};"> <td style="text-align: left; width: 15%">{$order_detail.reference}</td> <td style="text-align: left; width: 30%">{$order_detail.product_name}</td> <!-- unit price tax excluded is mandatory --> {if !$tax_excluded_display} <td style="text-align: right; width: 10%"> {displayPrice currency=$order->id_currency price=$order_detail.unit_price_tax_excl} </td> {/if} <td style="text-align: right; width: 10%"> {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: 10%"> {if (isset($order_detail.reduction_amount) && $order_detail.reduction_amount > 0)} -{displayPrice currency=$order->id_currency price=$order_detail.reduction_amount} {else if (isset($order_detail.reduction_percent) && $order_detail.reduction_percent > 0)} -{$order_detail.reduction_percent}% {else} -- {/if} </td> <td style="text-align: center; width: 10%">{$order_detail.product_quantity}</td> <td style="width: 15%; text-align: right; width: {if !$tax_excluded_display}15%{else}25%{/if}"> {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:6px;background-color:{$bgcolor}; "> <td style="line-height:3px; text-align: left; width: 60%; vertical-align: top">[/color] [color="#000088"] <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"> </div> {/if} {/foreach} {/if}[/color] [color="#000088"] {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 -->[/color] [color="#000088"] <!-- CART RULES --> {assign var="shipping_discount_tax_incl" value="0"} {foreach $cart_rules as $cart_rule} {if $cart_rule.free_shipping} {assign var="shipping_discount_tax_incl" value=$order_invoice->total_shipping_tax_incl} {/if} {cycle values='#FFF,#DDD' assign=bgcolor} <tr style="line-height:6px;background-color:{$bgcolor}" text-align="left"> <td style="line-height:3px;text-align:left;width:60%;vertical-align:top" colspan="{if !$tax_excluded_display}5{else}4{/if}">{$cart_rule.name}</td> <td> {if $tax_excluded_display} - {$cart_rule.value_tax_excl} {else} - {$cart_rule.value} {/if} </td> </tr> {/foreach} <!-- END CART RULES --> </table>[/color] [color="#000088"] <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>[/color] [color="#000088"] <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}[/color] [color="#000088"] {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}[/color] [color="#000088"] {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}[/color] [color="#000088"] {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}[/color] [color="#000088"] {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}[/color] [color="#000088"] <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>[/color] [color="#000088"] </table>[/color] [color="#000088"] </td> </tr> </table> <!-- / PRODUCTS TAB -->[/color] [color="#000088"]<div style="line-height: 1pt"> </div>[/color] [color="#000088"]{$tax_tab}[/color] [color="#000088"]{if isset($order_invoice->note) && $order_invoice->note} <div style="line-height: 1pt"> </div> <table style="width: 100%"> <tr> <td style="width: 15%"></td> <td style="width: 85%">{$order_invoice->note|nl2br}</td> </tr> </table> {/if}[/color] [color="#000088"]{if isset($HOOK_DISPLAY_PDF)} <div style="line-height: 1pt"> </div> <table style="width: 100%"> <tr> <td style="width: 15%"></td> <td style="width: 85%">{$HOOK_DISPLAY_PDF}</td> </tr> </table> {/if}[/color] [color="#000088"]</div>[/color] [color="#000088"] Edited August 28, 2013 by shiggidydog (see edit history) Link to comment Share on other sites More sharing options...
europaul Posted January 19, 2014 Share Posted January 19, 2014 Hello !. Interesting topic. Is there also a chance to add the product features in a new column instead all together ?. I have teas with its weight , but the weight has to be in a new column. For example: PRODUCT White Tea - 100 grms. I need: PRODUCT WEIGHT White Tea 100 grms Thanks !!!!!! Link to comment Share on other sites More sharing options...
MarcoVan Posted March 25, 2014 Share Posted March 25, 2014 @shiggidydog thanks very much for your template! Cheers Link to comment Share on other sites More sharing options...
dr06u Posted April 23, 2014 Share Posted April 23, 2014 (edited) Yes! Solved changing row n.129 with this one: <td style="text-align: left; width: 45%">{$order_detail.product_name} / {$order_detail.reference}</td> Thanks! For me it does not work, it simply doesn't show the number. Any ideea why? (I'm using PrestaShop™ 1.5.6.2). Thanks in advance. Later edit: SOLVED using {counter} like this: <td style="text-align: left; width: 45%">{$order_detail.product_name} / {counter}</td> Edited April 23, 2014 by dr06u (see edit history) Link to comment Share on other sites More sharing options...
jopabe Posted June 18, 2014 Share Posted June 18, 2014 Hey, nice topic, people helping people! I wonder, maybe someone can give me a hint: I have Prestashop 1.6 and suddenly my invoices lost the product lines, and only show the header and the total amount. I have done nothing to make it like it is now, but I also can't find a solution to make it better... Help? Anyone?... Link to comment Share on other sites More sharing options...
tuk66 Posted June 19, 2014 Share Posted June 19, 2014 That's the known problem. Search the forum for a fix. Link to comment Share on other sites More sharing options...
jopabe Posted June 19, 2014 Share Posted June 19, 2014 Thanks, M4 I have been looking everywhere in the Forum and outside, but no luck, yet. But if it is a know and fixed problem, there's hope I can find it. Cheers, Link to comment Share on other sites More sharing options...
tomes Posted January 28, 2015 Share Posted January 28, 2015 Working great. Link to comment Share on other sites More sharing options...
Tung at RockPOS.com Posted February 27, 2015 Share Posted February 27, 2015 (edited) Good one, works for me. Thank you! Edited February 27, 2015 by Tung.CEO (see edit history) 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