Jump to content

Add client discount to Order Confirmation email template


SeanP

Recommended Posts

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated