product detail page - move block to primary product container
-
18-03-2021 - |
Domanda
I would like to move the static block (a custom block from infortis ultimo theme) block_product_secondary_bottom
to the container_product_primary_1
container after product.info.price
. How do I do that? thanks
below is part of the catalog_product_view.xml
<referenceContainer name="content">
<block class="Infortis\Base\Block\Product\View" name="product-view-wrapper" template="product/view.phtml" before="-">
<container name="container_product_image_1" label="Product View, Image Column" />
<container name="container_product_primary_1" label="Product View, Primary Column, Container 1" />
<container name="container_product_primary_2" label="Product View, Primary Column, Container 2" />
<container name="container_product_secondary_1" label="Product View, Secondary Column, Container 1" />
<container name="container_product_secondary_2" label="Product View, Secondary Column, Container 2" />
<container name="container_product_lower_primary_1" label="Product View, Lower Primary Column, Container 1" />
<container name="container_product_lower_primary_2" label="Product View, Lower Primary Column, Container 2" />
<container name="container_product_lower_secondary_1" label="Product View, Lower Secondary Column, Container 1" />
<container name="container_product_lower_secondary_2" label="Product View, Lower Secondary Column, Container 2" />
<!-- Static blocks -->
<block class="Magento\Cms\Block\Block" name="block_product_secondary_bottom">
<arguments>
<argument name="block_id" xsi:type="string">block_product_secondary_bottom</argument>
</arguments>
</block>
</block>
</referenceContainer>
<!-- Insert product view blocks into the new product view wrapper -->
<move element="product.info.main" destination="product-view-wrapper" />
<move element="product.info.media" destination="product-view-wrapper" />
<move element="bundle.options.container" destination="product-view-wrapper" />
<move element="product.info.details" destination="product-view-wrapper" />
<move element="catalog.product.related" destination="product-view-wrapper" />
<move element="product.info.upsell" destination="product-view-wrapper" />
<!-- Move some blocks to new positions -->
<!-- <move element="product.info.stock.sku" destination="product.info.price" after="product.price.final" /> -->
<!-- <move element="product.info.social" destination="product.info.main" after="-" /> -->
<move element="product.info.overview" destination="product.info.main" before="product.info.price" />
<move element="container_product_primary_1" destination="product.info.main" before="product.info.price" />
<!-- <move element="container_product_primary_2" destination="product.info.main" after="-" /> -->
<!-- Move some blocks outside the "product.info.main" to manipulate their position inside template file -->
<move element="page.main.title" destination="product-view-wrapper" />
<move element="product.info.review" destination="product-view-wrapper"/>
Soluzione
You just need to add below line in end of your file
<move element="block_product_secondary_bottom" destination="container_product_primary_1" after="product.info.price" />
Altri suggerimenti
you may try this.
<move element="block_product_secondary_bottom" destination="container_product_primary_1" />
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a magento.stackexchange