foreach ($order->getAllItems() as $item

   $orderItemId = $item->getOrderItemId();

   $orderItem = Mage::getModel('sales/order_item')->load($orderItemId);

   $product = Mage::getModel('catalog/product')->load($item->getProductId());

   $html.='<tr height="10">

     <td colspan="3">'.$product->getName().'</td>




With this code i am getting both simple and configurable product name but when i replace getAllItems by getAllVisibleItems then only show configurable product name but i want to show simple product name which was order


Try this answer,

foreach($order->getAllVisibleItems() as $item) {
    $childItems = $item->getChildrenItems();
    foreach($item->getChildrenItems() as $item){
       echo $item->getProduct()->getName(); // child product Name

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.