How can I get the name of a product in the order history page? I copied the view order code in but it's not working.
$_order = $block->getOrder()
<?php $_items = $_order->getItemsCollection(); ?>
<?php foreach ($_items as $_item){ ?>
<?php echo $block->getItemHtml($_item) }?>
Best Answer
Magento save order items name at
sales_order_item
table's at name columns.So you have order item object then usinggetName()
function for getting product name at any where.