1

I'm working on an Magento 2 webshop and I have implemented some code to show a custom block on the productpage. But it is showing before the Product Details / More Information (tabs).

In the file /app/design/frontend/Smartwave/porto_child/Magento_Catalog/layout/catalog_product_view.xml in this

<referenceContainer name="content">

I have added:

<container name="custom.bnr" htmlTag="div" htmlClass="custom-bnr-html" after="product.info.details"> <block class="Magento\Cms\Block\Block" name="bnr_product_info" after="-"> <arguments> <argument name="block_id" xsi:type="string">product-block-1</argument> </arguments> </block> </container> 

Somehow I cannot have it to be shown as the last element of the page. Somehow the div main-product-detail (with the tabs) is shown under the column main instead of inside it.

Does anyone know how to fix this? Thanks in advance!

Magento 2.4.4 Porto Theme

** LATER EDIT: I Think I found the "problem". The Porto Theme is adding some JavaScript to take the Product Tabs out of the container and put it below, to make it full width. So I was able to resolve it!

1 Answer 1

1

Try This Code

<referenceBlock name="product.info.details"> <block class="Magento\Review\Block\Product\Review" name="reviews.tab" as="reviews" template="Magento_Review::review.phtml" group="detailed_info" ifconfig="catalog/review/active"> <arguments> <argument name="sort_order" xsi:type="string">30</argument> </arguments> <block class="Magento\Review\Block\Form" name="product.review.form" as="review_form" ifconfig="catalog/review/active"> <container name="product.review.form.fields.before" as="form_fields_before" label="Review Form Fields Before"/> </block> </block> </referenceBlock> 

<argument name="sort_order" xsi:type="string">30</argument> This line is used for sorting.

1
  • Thanks, but I think I found the problem (see the original post) Commented Jul 26, 2022 at 7:55

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.