Magento 2, Magento Development, Customization, Extension Development and Integration, Optimization, SEO and Responsive Design

Magento 2, Magento Development, Customization, Extension Development and Integration, Optimization, SEO and Responsive Design

Get Configurable Product SKU and Its Simple Product SKU in Cart Page Magento

Put this code at templet/checkout/cart/item/default.phtml after this line "$_item = $this->getItem();"

<?php
echo $temp = $_item->getProductId();
echo "<br/>";
$_product = Mage::getModel('catalog/product')->load($temp);
echo "Config. Product :";
echo $_product->getSku();
echo "<br/>";

echo "Simple Product :";
echo $_item->getSku();
?>


Please support us, Like us on Facebook.

  1. This might be a simple question, but where are the root directories located?

    I am new to Magento. Thank you.

    ReplyDelete
  2. app/design/frontend/default/[YOUR THEME]/template/checkout/cart/item/default.phtml
    this might be your root directories.

    ReplyDelete
  3. It is ok.
    but I changed it because of more than one product in cart


    at the beginning
    getItem();
    $temp = $_item->getProductId();
    $_product = Mage::getModel('catalog/product')->load($temp);
    ?>

    After
    getProductAdditionalInformationBlock(); ?>

    setItem($_item)->toHtml() ?>


    insert

    getSku();?>

    Now only translating or formating is to do

    Mrs. Byte

    ReplyDelete

 

Copyright @ 2017 HKBlog.