Magento – How to Display the Product SKU

Magento is a pretty flexible platform. That flexibility comes with a price though; You have to be knowledgeable of the functions that are available to you to utilize. Finding or knowing them is a challenge though. Here is one of those such functions that you may need to display the product Sku on a category page.

 

4 thoughts on “Magento – How to Display the Product SKU”

  1. In the shopping cart. I want to retrieve the SKU of a configurable product. The code you show here returns the SKU of the base configurable product. I want the SKU of the product after the options have been specified by the user. How do I get that?

  2. {syntaxhighlighter brush: php}

    if (is_object($this->getChildProduct())):

    echo $this->getChildProduct()->getSku();

    else:

    echo $_item->getSku();

    endif;

    {/syntaxhighlighter}

  3. Try this

    {syntaxhighlighter brush: php}

    < ?php $_product = new Mage_Catalog_Model_Product(); $_product->load($this->getProduct()->getId());

    $_productSku=$_product->getSku();

    echo $_productSku;

    ?>

    {/syntaxhighlighter}

Leave a Reply

Your email address will not be published. Required fields are marked *