Archived topic
SKU column in Woocommerce order email
9 replies · Started by Alberto on October 15, 2020
Hi.
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.
Hi there,
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:
https://woocommerce.com/posts/how-to-customize-emails-in-woocommerce/
Hi David.
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!
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.php
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.
Then it is this template you would need to edit:
Thanks a lot, David.
Forgive my ignorance, (I understand very little code) does this code include the separate SKU column?
Thank you very much.
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:
https://w3programmings.com/how-to-add-sku-to-woocommerce-order-emails/
If this still works then you won't need to edit those templates
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!
Unfortunately to do that you would need to find a developer who speciailises in woocommerece email templates. Maybe someone on codeable.io