- This topic has 9 replies, 2 voices, and was last updated 4 months, 2 weeks ago by David.
October 15, 2020 at 4:44 am #1490116Alberto
I am needing to add a column with the SKU field to the Woocommerce order email.
Currently the SKU is displayed next to the product name (in the same product column), but I need the SKU to be in a separate column.
I read somewhere on the web that you have to edit certain files of the theme, but I don’t know exactly which files they are or how to do it.
I have looked for a plugin that does it automatically, but I have not found anything …
Thank you in advance.October 15, 2020 at 5:24 am #1490169DavidStaffCustomer Support
Email templates are controlled by Woocommerce not the theme.
You would either need to custom code your own templates, or check the wordpress repository as there are a number of plugins that do that for you.
For reference here is Woocommerces info:October 15, 2020 at 5:57 am #1490215Alberto
Thanks for your answer.
I found this link on the web. Could you tell me how true it is and if it is enough to just do that?
Thank you!October 15, 2020 at 6:13 am #1490236DavidStaffCustomer Support
That is correct – but that is an old topic and is pointing to an old email template of Woocommerce.
Here is the most up to date version of that template:
https://github.com/woocommerce/woocommerce/blob/master/templates/emails/email-order-details.phpOctober 15, 2020 at 6:45 am #1490287Alberto
Thanks David for your answer but I have a question:
The file that I need to modify is admin-new-order.php and this one that you indicate is email-order-details.php
I need the SKU to be displayed in a separate column but only in the email that the store administrator receives.
I will appreciate if you can guide me.October 15, 2020 at 7:32 am #1490358DavidStaffCustomer Support
Then it is this template you would need to edit:October 15, 2020 at 7:34 am #1490361Alberto
Thanks a lot, David.
Forgive my ignorance, (I understand very little code) does this code include the separate SKU column?
Thank you very much.October 15, 2020 at 7:41 am #1490368DavidStaffCustomer Support
I found this article – it actually provides a PHP snippet to go in your functions.php to add the SKU next to the product title:
If this still works then you won’t need to edit those templatesOctober 15, 2020 at 7:46 am #1490375Alberto
Thanks David, but it’s not what I’m looking for …
Notice that the SKU is inside the “Product” column and I need the SKU to be displayed in a separate column.
The email code you passed me last (https://github.com/woocommerce/woocommerce/blob/02cf0dfaed5923513de0c88add597d1560c2cfd2/templates/emails/admin-new-order.php), does it include the SKU as a separate column?
Thank you!October 15, 2020 at 7:51 am #1490560
- You must be logged in to reply to this topic.