Add SKU to Shopping Cart in Magento

I’m going to show you quickly how to add a SKU to your Magento Cart.

  1. Open the following file: /app/design/frontend/default/(yourTheme)/template/checkout/cart/item/default.phtml
  2. Locate your Item Array. Mine looks like this:
    $_item = $this->getItem();
  3. Add an variable for the
    SKU: $itemSKU = $_item->getSku();
  4. Around line 96 you should see a function similar to, but not always 100% the same:
    <h2 class="product-name">
           <!--?php if ($this--->hasProductUrl()):?>
               <a href="/<?php echo $this->getProductUrl() ?>"><!--?php echo $this--->htmlEscape($this->getProductName()) ?></a>
               <p><strong>SKU: <!--?php echo $itemSKU; ?--></strong></p>
           <!--?php else: ?-->
               <!--?php echo $this--->htmlEscape($this->getProductName()) ?>
           <!--?php endif; ?-->
  5. Add your SKU
    <p><strong>SKU: <!--?php echo $itemSKU; ?--></strong></p>


Cove Technology

Recent Posts

Mailchimp and Mandrill Database Issues

Over the next week your Contact Us Form may stop working. Why? MailChimp is having database issues and “it’s possible…

8 months ago

Should you update to iOS 12.2?

TL;DR It's imperative to update to iOS 12.2 as soon as you can. If you are unfamiliar with the FaceTime…

8 months ago

Ashton Kutcher’s Real Phone Number Partnership

As you're waking up, drinking your coffee and starting your day, news is breaking that Ashton Kuther released his personal…

8 months ago

Setting Up A Successful E-Commerce Business

Post written by Anne Farrimond The internet is a dream come true for a lot of budding entrepreneurs. Being able…

3 years ago

Update UConnect for Chrysler Vehicles 0Day Vulnerability

Its extremely important that you immediately update your Chrysler Vehicle's UConnect System. Why? Hackers Remotely Kill a Jeep on the…

4 years ago

MIT Providing Free Online Courses on Game Design

MITx: Design and Development Courses Want to learn how to build and develop the newest educational technology? MIT is now…

5 years ago