Remove SKU Column from Transactional Emails
-
12-12-2019 - |
Question
I would like to know how to remove the SKU column from transactional emails my store sends.
The email template contains {{var order.shipping_description}}
but I don't know where this block is pulled from.
At least I assume that's what's rendering the table of info displayed in the following image:
Solution
You need to edit two files:
File 1:
app/design/frontend/base/default/template/email/order/items.phtml
Find the following line and comment it:
<th align="left" bgcolor="#EAEAEA" style="font-size:13px; padding:3px 9px"><?php echo $this->__('Sku') ?></th>
-----OR-----
empty the value as:
<th align="left" bgcolor="#EAEAEA" style="font-size:13px; padding:3px 9px">&nsbp;</th>
File 2:
app/design/frontend/base/default/template/email/order/items/order/default.phtml
And comment the following line:
<td align="left" valign="top" style="font-size:11px; padding:3px 9px; border-bottom:1px dotted #CCCCCC;"><?php echo $this->escapeHtml($this->getSku($_item)) ?></td>
-----OR-----
empty the value as:
<td align="left" valign="top" style="font-size:11px; padding:3px 9px; border-bottom:1px dotted #CCCCCC;"> </td>
Hope this helps.
OTHER TIPS
So the directive
{{var order.shipping_description}}
is for the output of the shipping description (above of the order items list).
The order items list is usually generated by following directive:
{{layout handle="sales_email_order_items" order=$order}}
So to find out where this is defined you have to find the layout-handle sales_email_order_items, which is usually set in base/default/layout/sales.xml
<sales_email_order_items>
<block type="sales/order_email_items" name="items" template="email/order/items.phtml">
<action method="addItemRender"><type>default</type><block>sales/order_email_items_order_default</block><template>email/order/items/order/default.phtml</template></action>
<action method="addItemRender"><type>grouped</type><block>sales/order_email_items_order_grouped</block><template>email/order/items/order/default.phtml</template></action>
<block type="sales/order_totals" name="order_totals" template="sales/order/totals.phtml">
<action method="setLabelProperties"><value>colspan="3" align="right" style="padding:3px 9px"</value></action>
<action method="setValueProperties"><value>align="right" style="padding:3px 9px"</value></action>
<block type="tax/sales_order_tax" name="tax" template="tax/order/tax.phtml">
<action method="setIsPlaneMode"><value>1</value></action>
</block>
</block>
</block>
<block type="core/text_list" name="additional.product.info" />
</sales_email_order_items>
So the files you need to extend or overwrite in your custom theme are email/order/items.phtml for the headline and the defined item rendereres for the different type of product types.