1

I am trying to get the all tab names and respective contents which are uses in product detail page.

Please explain how this code line works and how to use it our custom module to get the all child html of a particular node name?

<?php $detailedInfoGroup = $block->getGroupChildNames('detailed_info', 'getChildHtml'):?>

Location: vendor/magento/module-catalog/view/frontend/templates/product/view/details.phtml

  • did you find the answer yet? because i'm in your sistution :( – fudu Oct 6 '18 at 4:36
0

Have a look at this link: https://github.com/magento/magento2/blob/2.2-develop/app/code/Magento/Catalog/view/frontend/templates/product/view/details.phtml

More specifically, line 10:

<?php if ($detailedInfoGroup = $block->getGroupChildNames('detailed_info', 'getChildHtml')):?>

Line 14:

<?php foreach ($detailedInfoGroup as $name):?>

And line 16:

$layout->renderElement($name)

This should be the most basic thing you need to check if there are child in a specific group, loop through those child and render them.

| improve this answer | |

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.