sumitbatra Posted March 21, 2015 Share Posted March 21, 2015 Is it possible to add base price(price before discount) in invoice.. as currently it is only showing price after discount and discount only.. Link to comment Share on other sites More sharing options...
tuk66 Posted March 23, 2015 Share Posted March 23, 2015 Do you mean something like this?http://www.presta-addons.com/pdf/Invoices with discount.pdf What is your version? Link to comment Share on other sites More sharing options...
sumitbatra Posted March 23, 2015 Author Share Posted March 23, 2015 Yes exactly but with taxes disabled.. My version is 1.5.6 And site is nukkadshop.in Link to comment Share on other sites More sharing options...
Plika1988 Posted September 2, 2015 Share Posted September 2, 2015 (edited) Exactly what I'm looking for too. Did you ever get a solution? Never mind after some tinkering I have the solution. I can now add prices to my invoice before the discount reduction (with and without tax). I simpely changed a bit of code in the file classes/PDF/HTMLTemplateInvoice.php from this: $has_discount = false; foreach ($order_details as $id => &$order_detail) { // Find out if column 'price before discount' is required if ($order_detail['reduction_amount_tax_excl'] > 0) { $has_discount = true; $order_detail['unit_price_tax_excl_before_specific_price'] = $order_detail['unit_price_tax_excl_including_ecotax'] + $order_detail['reduction_amount_tax_excl']; } elseif ($order_detail['reduction_percent'] > 0) { $has_discount = true; $order_detail['unit_price_tax_excl_before_specific_price'] = (100 * $order_detail['unit_price_tax_excl_including_ecotax']) / (100 - $order_detail['reduction_percent']); } to this: $has_discount = false; foreach ($order_details as $id => &$order_detail) { // Find out if column 'price before discount' is required if ($order_detail['reduction_amount_tax_incl'] > 0) { $has_discount = true; $order_detail['unit_price_tax_incl_before_specific_price'] = $order_detail['unit_price_tax_incl_including_ecotax'] + $order_detail['reduction_amount_tax_incl']; } elseif ($order_detail['reduction_percent'] > 0) { $has_discount = true; $order_detail['unit_price_tax_incl_before_specific_price'] = (100 * $order_detail['unit_price_tax_incl_including_ecotax']) / (100 - $order_detail['reduction_percent']); } if ($order_detail['reduction_amount_tax_excl'] > 0) { $has_discount = true; $order_detail['unit_price_tax_excl_before_specific_price'] = $order_detail['unit_price_tax_excl_including_ecotax'] + $order_detail['reduction_amount_tax_excl']; } elseif ($order_detail['reduction_percent'] > 0) { $has_discount = true; $order_detail['unit_price_tax_excl_before_specific_price'] = (100 * $order_detail['unit_price_tax_excl_including_ecotax']) / (100 - $order_detail['reduction_percent']); } The next step is to edit your PDF/invoice.tpl file For example you can add the code: {if isset($layout.before_discount)} <td style="text-align: right; width: 13%; border-left: 1px solid #9E9F9E; border-top: 1px solid #9E9F9E;"> {if isset($order_detail.unit_price_tax_excl_before_specific_price)} {displayPrice currency=$order->id_currency price=$order_detail.unit_price_tax_excl_before_specific_price} {else} -- {/if} </td> {/if} This will show you the product price before the discounted price ( excl tax) To show the price incl tax just edit: order_detail.unit_price_tax_excl_before_specific_price to order_detail.unit_price_tax_incl_before_specific_price I hope this helps a bit. I forgot to mention that i'm currently using the newest version of prestashop (1.6.1.1) Edited September 2, 2015 by Plika1988 (see edit history) 2 1 Link to comment Share on other sites More sharing options...
DavidSidecar Posted June 22, 2017 Share Posted June 22, 2017 AWESOME! Link to comment Share on other sites More sharing options...
[email protected] Posted December 17, 2017 Share Posted December 17, 2017 A simpler solution that does not require changes to the class generator is doing a little math in the pdf template during generation: {displayPrice currency=$order->id_currency price=($order_detail.unit_price_tax_incl + $order_detail.reduction_amount_tax_incl)} /OhmegaStar 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