Closed (fixed)
Project:
Commerce Email
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
5 Nov 2011 at 16:00 UTC
Updated:
16 Jun 2020 at 18:59 UTC
Jump to comment: Most recent, Most recent file

Comments
Comment #1
yaudouin commentedSuscribe
Comment #2
Slacker commentedSubscribe!
Comment #3
kevster commentedSubscribe - very useful for me!
Comment #4
TomGould01 commentedSubscribing,
A clinet wants this!
Comment #5
andyg5000See this thread: http://drupal.org/node/1532526 I've provided a sandbox module that creates a new token. You can use this module to create your own and edit to pull in the info you need.
Comment #6
dylanrao commentedThanks 5000 andy, I was fighting this before I found your module. This probably should come out of sandbox, it seems like something Commerce mail should be capable of. SKU# are a pretty common requirement IMHO.
Comment #7
zpolgar commentedAdd discount feature will be the super solution.
Comment #8
ptmkenny commentedI'm attaching a patch to add the discount to the token output. I didn't add the SKU because I did not need it (or want it) for my case; the SKU seems best left to a case-by-case basis.
However, in the case of discounts, I think that not showing the discount is a bug.
See the attached images. Since the "subtotal" and "total" are included, skipping the discount leads to the total being unexpectedly reduced, which can cause recipients to wonder if the discount was in fact applied.
Comment #9
summit commentedHi,
Thanks for adding discount.
Couldn't you add an option to y/n show sku.
I would love to have sku in the email.
Also for customer referral.
Greetings, Martijn
Comment #10
ptmkenny commentedIf you want to add SKU, referral, etc., you should check out the patch in #1332698: Allow theming of [commerce-order:commerce-email-order-items] (which has already been committed). You can write your own theme function for that.
My patch includes only the discount because the Subtotal and Total are already included, so omitting the discount can lead to very strange looking e-mails, which I think is a bug.
Comment #11
vrMarc commentedThis line in the patch didn't work for me -
elseif ($data['components'][$key]['name'] == 'discount')It turns out that I had to use 'commerce_coupon_the_name_of_the_discount_code' instead of 'discount'. Since new coupon codes would be added and I don't want to have to add each discount code to commerce_email.module, I used this instead -
elseif (strpos($data['components'][$key]['name'], 'commerce_coupon') !== false)Comment #12
rossb89 commentedMade a new version of the patch, to work with the newer version of commerce discount where the key is 'discount|machine_name_of_discount' not just 'discount'.
Takes into account the customer facing title configured for the discount as well.
Comment #13
IckZ commentedthanks a lot @rossb89: I've just noticed today, that the title is missing in the mails. I'm testing now your patch!
Comment #14
mrP commentedPatch #12 applies cleanly and works for me with commerce_discount-7.x-1.0-beta5. Thanks!
Updating title to reflect the patch is for discount only. +1 RBTC
Comment #15
rszrama commentedChecking to see if it still applies...
Comment #17
rszrama commentedPatch checks out. Didn't test in local dev but committing based on community feedback.