How can I get product details like product type and name in particular product reviews list page.

Actually I want to Display "Product-Name reviews" Instead of "Customer Reviews" in product detail page.

Any help would be appreciated, Thanks.

  • Are you want to get product name in review tab in details page Dec 16 '16 at 12:16
  • yes, In place of ''customers review' I need '[product name] review'. Dec 16 '16 at 12:20
  • We can get product data directly on our template: $block->getProduct() in our template. Dec 16 '16 at 12:32
  • ok @KhoaTruongDinh, Will try this Dec 16 '16 at 12:36

Copy product/view/list.phtml to your custom theme. We get product data directly on our template: $block->getProduct().


<?php $productName = $block->getProduct()->getName(); ?>

 <div class="block-title">
    <!--        <strong>--><?php ///* @escapeNotVerified */ echo __('Customer Reviews') ?><!--</strong>-->
    <strong><?php  echo $productName; ?></strong>

you can get product id from review block


public function getProductId()
        $product = $this->_coreRegistry->registry('product');
        return $product ? $product->getId() : null;

in phtml get id of product

  • ok, @Fme I wil try this. Dec 16 '16 at 12:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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