0
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>'.$item->getSku().'</td>

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

     <td>'.(int)$orderItem->getQtyBackordered().'</td>

     <td>'.(int)$item['qty_ordered'].'</td>

   </tr>';
}

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

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 you have read our privacy policy.

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