magento2.2.6 – How to display a custom group product page layout?

I would like my Magento 2.2.6 store to have two grouped product pages. For some bundled products, I would like to use the existing default bundle product layout provided with Magento 2. For other bundled products, I would like to use my own custom bundled product layout. For this question, let's say that I would like my custom batch product layout to simply move the list of grouped products from the default position (to the right of the gallery), as shown below:

Grouped products displayed to the right of the gallery

to display them under the gallery, as shown here:

Grouped products displayed under the gallery

To try to do this, I created the following layout app / code /[COMPANY]/[MODULE]/view/frontend/layout/catalog_product_view_type_grouped.xml to extend the existing provider / magento / grouped product-module / view / frontend / layout / catalog_product_view_type_grouped.xml:


With this single file, the list of products grouped together (the product information block) is correctly moved below the gallery. However, it is moved for all bundled products, not just for my specific bundled products.

I believe (I admit that I may be wrong) that what I need to do is to specify a custom layout for the product grouped in the product design section:

Selecting the layout in the product administrator

To do this, I created the following layouts.xml file:

app / code /[COMPANY]/[MODULE]/view/frontend/layouts.xml:


And added the correspondent app / code /[COMPANY]/[MODULE]/view/frontend/page_layout/custom_grouped_product.xml layout file:

I've selected the layout in relation to the product in the product's admin page, but that's pretty much everything I've got.

How to connect the catalog_product_view_type_grouped.xml layout file to extension custom_grouped_product.xml layout file so that the layout file is only displayed when the custom_grouped_product.xml is selected in the product admin?

And by the way (and I admit it might be another question), should I use a module or theme to achieve the above? I've used a module here because I understand that the themes are primarily intended for style, so I would greatly appreciate any advice on this as well.