2

In my product page I have the details and reviews shown separated but I want them in the same part. I have this:

enter image description here

where "Detalhes" is the details part and "Avaliações" is the review part. I want it to look like this:

enter image description here

Could someone tell me how can I do that? I´m kind of lost

thank you!

1

Alright if we want to do this we'll first have to look at how these elements are constructed in the original layout/phtml files.

  1. If you check module-catalog/view/frontend/layout/catalog_product_view.xml you'll see an element <block class="Magento\Catalog\Block\Product\View\Description" name="product.info.details" template="Magento_Catalog::product/view/details.phtml" after="product.info.media"> that seems to be the wrapper for the product.info.description element as well as an additional product.attributes element.
  2. Similarly, in module-review\view\frontend\layout\catalog_product_view.xml you can see a block called reviews.tab being added to the product.info.details block

So to change this behavior we can make a simple adjustment by overriding Magento_Catalog::product/view/details.phtml in our theme:

app/design/frontend/Vendor/Mytheme/Magento_Catalog/templates/product/view/details.phtml

<div class="product-info-wrap">
    <?php echo $block->getChildHtml(); ?>
</div>

Clear the cache and you'll no longer see the tab structure. You can now make adjustments to the individual blocks and templates to match your desired design.

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.