I want get number of product order in order success page. This found solution magento 1.9 visit Get ordered product count in magento

<?php $_order = $this->getOrder() ?>
<?php echo $_order->getTotalItemCount();?>

but I didn't get any solution in Magento 2

If anyone know Get order product item count in order success page phtml file, please share with me,Thanks for advance

1 Answer 1


Add a custom block for onepage which calculates & returns the product count.


Then you'd be able to grab it on the success page.

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.