2

I'm modifying the layout of the product view.

I'm trying to move and edit the product related block "catalog.product.related".

In my catalog_product_view.xml I have :

 <referenceContainer name="content.aside">
 <block class="Taschert\Example\Block\Product\Test" after="-" name="taschert.list.test" template="Taschert_Example::product/test.phtml">
 <arguments>
 <argument name="section" xsi:type="string">productpage</argument>
 <argument name="position" xsi:type="number">1</argument>
 </arguments>
 </block>
 <referenceBlock name="catalog.product.related" after="taschert.list.test"
 template="Taschert_Example::product/list/items.phtml">
 <arguments>
 <argument name="type" xsi:type="string">related</argument>
 <argument name="section" xsi:type="string">productpage</argument>
 <argument name="position" xsi:type="number">1</argument>
 </arguments>
 </referenceBlock>
 </referenceContainer>

The block product related use my custom template but show before my first block. Did I miss something ?

I have tried just to move the block with no result.

<move element="catalog.product.related" destination="content.aside" after="taschert.list.test"/>

I've clear my cache.

asked Jun 24, 2016 at 15:11

3 Answers 3

1
<move element="catalog.product.related" destination="product.info.main" before="-" />

Just flush the cache

answered Dec 8, 2018 at 9:52
0

You can use that code with default catalog_product_view.xml

<move element="catalog.product.related" destination="product.info.main" after="product.info.details" />
answered Feb 27, 2018 at 12:11
0

In your XML you have the tag after="-", this means that this block is called after all the blocks.
Remove this piece of code from the first block, flush cache and check again.

answered Feb 27, 2018 at 12:17

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.