ktraving Posted March 24, 2015 Share Posted March 24, 2015 After having completed a few test orders on our web shop I stumbled across a few things that needs changing, before we can go live. One of them is the order confirmation email, in which discounts and gift wrapping costs are shown regardless of the amount. I would like them to be shown ONLY if they are greater than 0. Can I change this in the back office under localization->translations->email-translations ? It seems to be limited to basic HTML / TinyMCE. I have also had a look in the mails folder, and here the order-conf.html seems to be the place to go, but its HTML, and thus conditional coding doesn't seem possible? Ideas and suggestions are greatly appreciated. Cheers, K Link to comment Share on other sites More sharing options...
pette Posted April 30, 2015 Share Posted April 30, 2015 I'm searching too where I can insert a condition in the email order template Link to comment Share on other sites More sharing options...
intandem Posted October 7, 2015 Share Posted October 7, 2015 (edited) After having completed a few test orders on our web shop I stumbled across a few things that needs changing, before we can go live. One of them is the order confirmation email, in which discounts and gift wrapping costs are shown regardless of the amount. Apologies for highjacking your post but you mention the display of discount figures. Are you able to show discount amounts correctly in your order confirmation emails? For me, it's always a '0'. Our discounts are driven by the customer group. In the order confirmation, it shows the line item price already including the discount and then a 0 isn the discount line. I was just wondering wether it is working correctly for you. Thanks!! Edited October 7, 2015 by intandem (see edit history) Link to comment Share on other sites More sharing options...
Juanle Posted November 25, 2015 Share Posted November 25, 2015 As far as i know, all payment modules extends PaymentModule class, so in validateOrder() you could add new fields in $data, which is an array used near Mail::Send, over line 705. So you could create a string variable like: $discount_html=($order->total_discounts)?'<tr class="conf_body"> <td bgcolor="#f8f8f8" colspan="4" style="border:1px solid #D6D4D4;color:#333;padding:7px 0"> <table class="table" style="width:100%;border-collapse:collapse"> <tr> <td width="10" style="color:#333;padding:0"> </td> <td align="right" style="color:#333;padding:0"> <font size="2" face="Open-sans, sans-serif" color="#555454"> <strong>Descuentos</strong> </font> </td> <td width="10" style="color:#333;padding:0"> </td> </tr> </table> </td> <td bgcolor="#f8f8f8" colspan="4" style="border:1px solid #D6D4D4;color:#333;padding:7px 0"> <table class="table" style="width:100%;border-collapse:collapse"> <tr> <td width="10" style="color:#333;padding:0"> </td> <td align="right" style="color:#333;padding:0"> <font size="2" face="Open-sans, sans-serif" color="#555454"> '.Tools::displayPrice($order->total_discounts, $this->context->currency, false).' </font> </td> <td width="10" style="color:#333;padding:0"> </td> </tr> </table> </td> </tr>':''; and inside $data '{discount_html}' => $discount_html, finally if you go to your email html template, remove da '<tr>' that correspond to discount (line 152 in order_conf.html) and add '{discount_html}', it will only show discounts when its greater than 0 1 Link to comment Share on other sites More sharing options...
Casper_O Posted January 2, 2018 Share Posted January 2, 2018 Interested in if possible or not, beside making the override solution Link to comment Share on other sites More sharing options...
ingrossoerisparmio Posted October 3, 2019 Share Posted October 3, 2019 Hi, i have not understand. Is possible to insert conditional content in html mail template? Anyone have experience? 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