I am working on magento 2.1.8. In the my dashboard
There are orders listing. But i want the product name of that order also.
right now product name could be shown by clicking on the view all list. This order is coming from recent.phtml
. I also tried to get the product name from. order>items>renderer>default.html
The code i copy was this.
<?php echo $block->escapeHtml($_item->getName()) ?>
how ever i am still not able to get this. Can any body help me in this regard.?
Best Answer
You need to fetch order Items using
getAllVisibleItems()
function of order object.You can print the Ordered Items name in
recent.phtml
using the below code in$_orders
foreach loop:Hope this help !!