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

1 Answer 1


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 and acknowledge that you have read and understand our privacy policy and code of conduct.

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