Try the Demo

Magento

eCommerce Software for Online Growth

Magento Forum

Our new hosted solution for small & emerging businesses
   
Display SKU # on shopping cart/order page…? 
 
juju.
Jr. Member
 
Total Posts:  5
Joined:  2009-09-29
 

Hello!
My client has requested that on the Shopping cart page, the product’s SKU number be displayed along with the photo, product name, unit price, quantity & subtotal fields. Could you please help me in figuring out how to do this? I am new to Magento and am not familiar enough with the core code structure to know what to edit or where.
Thanks in advance.

 
Magento Community Magento Community
Magento Community
Magento Community
 
SAM-I-AM
Jr. Member
 
Total Posts:  15
Joined:  2009-06-01
 

try
<?php echo $this->getChildProduct ()->getSku(); ?>

 Signature 

the FYI blog

 
Magento Community Magento Community
Magento Community
Magento Community
 
juju.
Jr. Member
 
Total Posts:  5
Joined:  2009-09-29
 

Perfect. It worked. Thanks!

 
Magento Community Magento Community
Magento Community
Magento Community
 
point4design
Sr. Member
 
Total Posts:  96
Joined:  2008-07-31
 

What file did you add this code to? I’d like to have the sku and product description show on the ‘view cart’ page.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Rich1000
Sr. Member
 
Total Posts:  78
Joined:  2009-06-26
 

I don’t know what that code above it… it didn’t work for me. Matter of fact, it broke the cart page.

But what does work for me is:

<?php echo $_item->getSku() ?>

Add that to your template file located under: checkout/cart/item/default.phtml

 
Magento Community Magento Community
Magento Community
Magento Community
 
bts-eu
Sr. Member
 
Total Posts:  81
Joined:  2008-05-07
 

Thank you Rich1000! Perfect!

 
Magento Community Magento Community
Magento Community
Magento Community
 
michael_in_pp
Jr. Member
 
Total Posts:  11
Joined:  2008-05-27
 

The store I’m currently working on has a mixture of configurable products and simple products and I found that to output the SKU with the product name in the cart I needed a combination of both the contributions above, specifically:

if (is_object($this->getChildProduct())): 
            echo 
$this->getChildProduct()->getSku();
        else: 
            echo 
$_item->getSku();
        endif;

 
Magento Community Magento Community
Magento Community
Magento Community
 
Rich1000
Sr. Member
 
Total Posts:  78
Joined:  2009-06-26
 

Good point.. thanks

 
Magento Community Magento Community
Magento Community
Magento Community
 
davedavedave
Sr. Member
 
Avatar
Total Posts:  231
Joined:  2007-08-31
 
michael_in_pp - 18 February 2010 08:28 AM

The store I’m currently working on has a mixture of configurable products and simple products and I found that to output the SKU with the product name in the cart I needed a combination of both the contributions above, specifically:

if (is_object($this->getChildProduct())): 
            echo 
$this->getChildProduct()->getSku();
        else: 
            echo 
$_item->getSku();
        endif;

Perfect, thank you!

 
Magento Community Magento Community
Magento Community
Magento Community
 
alokranjan
Jr. Member
 
Total Posts:  1
Joined:  2011-06-22
 
SAM-I-AM - 16 November 2009 06:32 AM

try
<?php echo $this->getChildProduct ()->getSku(); ?>

Thanks a lot

 
Magento Community Magento Community
Magento Community
Magento Community
 
joejoe
Member
 
Total Posts:  47
Joined:  2011-01-21
 

Can’t work out where to add this in 1.5.0.1 .... have things changed?

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top
 
© Copyright 2012 Magento Inc.
Privacy Policy|Terms of Service
Magento Community Count
701238 users|772 users currently online|497296 forum posts