Rohan Patil
Rohan Patil

Reputation: 1963

Magento Add SKU column in cart page and order email template

I am trying to add the SKU column into magento Cart page Item Grid section and order email template

As I am able to see the Grid on order view page with sku column by defalut in magento

How can I use order view section logic on Cart page and in email template? I am running on 1.7.0.2 Ver.

Here this is sku column by default added by magento only for order view page

Upvotes: 1

Views: 2584

Answers (1)

Axel
Axel

Reputation: 10772

The default Magento email template already includes the SKUs in it. If they are not there, check to make sure your theme isn't overriding the default email template files and removing it.

Here's how you can add the sku to the shopping cart page:

Adding the SKU to the Shopping Cart Page

1. Add "SKU" to the cart table header

  1. Open app/design/frontend/[package]/[theme]/template/checkout/cart.phtml (copy this file from the base theme to your current theme folder if it doesn't yet exist).

  2. Add the <th rowspan="<?php echo $mergedCells; ?>"><?php echo $this->__('SKU') ?></th> directly after the product name <th> tag:

    <th rowspan="<?php echo $mergedCells; ?>"><span class="nobr"><?php echo $this->__('Product Name') ?></span></th>
    <th rowspan="<?php echo $mergedCells; ?>"><?php echo $this->__('SKU') ?></th>
    

2. Add "SKU" to the cart table item records

  1. Open app/design/frontend/[package]/[theme]/template/checkout/item/default.phtml (copy this file from the base theme to your current theme folder if it doesn't yet exist).

  2. Insert the sku <td> directly after the <td> containing the Product Name:

    <td class="a-center">
        <?php echo $_item->getSku(); ?>
    </td>
    

Upvotes: 3

Related Questions