ptityop Posted September 10, 2022 Share Posted September 10, 2022 I am trying to replace the % discount instead of base price in the invoice, so I modified invoice.product-tab.tpl adding the following code <td style=" border-bottom: solid 0px black;text-align: right; width: 10%"> {if (isset($order_detail.reduction_amount) && $order_detail.reduction_amount > 0)} -{displayPrice price=$order_detail.reduction_percent}% {elseif (isset($order_detail.reduction_percent) && $order_detail.reduction_percent > 0)} -{$order_detail.reduction_percent}% {else} {if ($order_detail.reduction_amount > 0)} {$order_detail.reduction_amount} {else} - {/if} {/if} </td> This works fine on an invoice with discount but it does mess up the invoice when no discount is applied with the table headers not matching the column data so in an invoice with no discounted product I end up with the column with header tax rate showing up price exc tax for instance How can I avoid this so that the following code can work together (hope it makes sense ... ) <td style=" border-bottom: solid 0px black;text-align: right; width: 10%"> {if (isset($order_detail.reduction_amount) && $order_detail.reduction_amount > 0)} -{displayPrice price=$order_detail.reduction_percent}% {elseif (isset($order_detail.reduction_percent) && $order_detail.reduction_percent > 0)} -{$order_detail.reduction_percent}% {else} {if ($order_detail.reduction_amount > 0)} {$order_detail.reduction_amount} {else} - {/if} {/if} </td> <td style="border-buttom: solid 0px black; border-left: solid 1px black; text-align: right; line-height:20px;font-size:8px;"> {displayPrice currency=$order->id_currency price=($order_detail.product_quantity * $order_detail.unit_price_tax_excl)} </td> In advance thank you ! 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