Lessons in Magento Today

Hold on Cowboy

This blog post is pretty old. Be careful with the information you find in here. It's likely dead, dying, or wildly inaccurate.

Printing the SKU in the cart Simple or Configurable 

To print the sku in the shopping cart, even for Configurable (it will print the underlying simple product sku).

Place this code somewhere in: app/design/frontend/default/default/template/checkout/cart/item/default.phtml

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

This will now print the sku… onto more work.

Reference: http://www.magentocommerce.com/boards/viewthread/56728/#t214381

Did this help you out? It took me a few days to piece together all this information together, I hope this saves you some time (who knows, maybe the future me will be thankful I wrote this down). Let me know your thoughts. [email protected]