SeanP Posted February 3, 2021 Share Posted February 3, 2021 I have a client assigned to a client group that has a discount on it. Their discount gets applied to their invoices, but the "Order Confirmation" email template does not show the discount. This causes some confusion, as they see this email and think they didn't receive the discount. Is there any way to add the discount to this email template, if the client in fact has a discount? 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted February 3, 2021 Share Posted February 3, 2021 10 hours ago, SeanP said: Is there any way to add the discount to this email template, if the client in fact has a discount? not from settings - I suppose their argument would be that it's not an invoice email, so not financial in that sense... though the inconsistency between 2 emails sending different values would be annoying. in the email template, you could determine, using Smarty, whether the client is in a client group and so add a message to the content along the lines of "A discount will be applied to this order" or whatever.. that's just going to be a simple IF statement. {if $client_group_id eq '1'}10% Discount applied{elseif $client_group_id eq '2'}15% Discount applied{/if} you could use $client_group_name if you prefer, but I would tend to use IDs because they will be unique, whereas you could in theory give 2 client groups the same name.. and that way madness lies. 🤪 also, in the template, you would have no direct way to know the percentage discount for each client group, so that would need to be coded into the if statement. if you did need to know the percentage, and heaven forbid wanted to change pricing in the email, then you're probably heading off towards a PreEmailSend action hook where it manipulates the content before sending to the client. 0 Quote Link to comment Share on other sites More sharing options...
SeanP Posted February 4, 2021 Author Share Posted February 4, 2021 Thanks! I may have to just mention the discount was applied using the if statement logic you provided. It would really be nice to calculate the actual total, but it makes it a little tough when most of the template is just a {$order_details} tag! I setup a discount for a client, and on the first order they immediately contacted me about this notification having the wrong total. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.