1

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:

enter image description here

1
  • 1
    You need to combine Tobias Zander's answer and MagePsycho's answer. Tobias says to copy the files to your local theme, then you can edit them like MagePsycho says. It's bad practice to modify core files since they can be overwritten when you upgrade your Magento. – Robin Feb 19 '15 at 14:15
5

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;">&nbsp;</td>

Hope this helps.

11
  • thanks a lot for reply, i will check your solution and tell you soon.... – Baby in Magento Feb 19 '15 at 7:08
  • i did as like your solution. but some problem happened in css seems.... subtotal, shipping and handling and grand total need to move left.... what i have to do for this? – Baby in Magento Feb 19 '15 at 7:28
  • 1
    @user9434334345 will check and get back to you. – MagePsycho Feb 19 '15 at 7:32
  • 1
    @user9434334345 habe a look at sales/order/totals.phtml (mentioned in my answer), that's related to the totals. But please DO NOT edit these files directly, these are code files and shouldn't be touched to remian upgradability. Either overwrite them in your own theme or define different template files in the layout.xml. – Tobias Feb 19 '15 at 7:35
  • 1
    @user9434334345 Try to empty the <th> <td> values instead using '&nbsp;'? instead of removing them. should be an easy fix. – MagePsycho Feb 19 '15 at 7:46
4

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.

1
  • thanks a lot for reply, i will check your solution and tell you soon.... – Baby in Magento Feb 19 '15 at 7:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.