0

I've created a CMS block called

km_product_page_short_description

I want to call this CMS block in a custom block below the product description tabs (where the blue line is) as shown in the screenshot below

enter image description here

How can I do this?

I tried the following but it shows under add to cart instead of under product description tabs.

<referenceContainer name="product.info.main">
            <block class="Magento\Cms\Block\Block" name="myPromo" after="-">
                <arguments>
                    <argument name="block_id" xsi:type="string">km_product_page_short_description</argument>
                </arguments>
            </block>
        </referenceContainer>

UPDATE:

I have used this code block to get the custom CMS Block, however it shows above the product details tabs, instead of below the tabs.

enter image description here

 <referenceContainer name="content"> 
        <block class="Magento\Cms\Block\Block" name="km_product_page_short_description" after="-"> 
        <arguments> 
        <argument name="block_id" xsi:type="string">km_product_page_short_description</argument> 
        </arguments> 
        </block> 
        </referenceContainer>

Below is the entire code catalog_product_view.xml with the

<?xml version="1.0"?>
<!--
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceContainer name="content">
            <container name="product.info.wrapper" htmlTag="div" htmlClass="row">
                <container name="product.info.col.media" htmlTag="div" htmlClass="col-md-12 col-lg-6" />
                <container name="product.info.col.main" htmlTag="div" htmlClass="col-md-12 col-lg-6">
                    <container name="product.info.col.main.wrap" htmlTag="div" htmlClass="tt-product-single-info" />
                </container>
            </container>
            <block class="Magento\Catalog\Block\Product\View\Description" name="product.info.details.bot" template="Magento_Catalog::product/view/details.bottom.phtml">
                <block class="Magento\Catalog\Block\Product\View\Attributes" name="product.attributes.bot" as="additional.bot" template="Magento_Catalog::product/view/attributes.phtml" group="detailed_info_bot">
                    <arguments>
                        <argument translate="true" name="title" xsi:type="string">Product Details</argument>
                    </arguments>
                </block>
                <block class="Magento\Catalog\Block\Product\View\Description" name="product.info.description.bot" as="description.bot" template="Magento_Catalog::product/view/attribute.phtml" group="detailed_info_bot">
                    <arguments>
                        <argument name="at_call" xsi:type="string">getDescription</argument>
                        <argument name="at_code" xsi:type="string">description</argument>
                        <argument name="css_class" xsi:type="string">description</argument>
                        <argument name="at_label" xsi:type="string">none</argument>
                        <argument name="title" translate="true" xsi:type="string">Description</argument>
                    </arguments>
                </block>
            </block>
        </referenceContainer>


        <referenceContainer name="content.aside">
            <block class="Magento\Catalog\Block\Product\View\Additional" name="product.info.additional.bot" as="product_additional_data_bot"/>
        </referenceContainer>


        <referenceContainer name="content"> 
        <block class="Magento\Cms\Block\Block" name="km_product_page_short_description" after="-"> 
        <arguments> 
        <argument name="block_id" xsi:type="string">km_product_page_short_description</argument> 
        </arguments> 
        </block> 
        </referenceContainer>


        <block class="Ecomwares\Wokiee\Block\Template" name="product_socials" template="html/product_socials.phtml"/>
        <block class="Ecomwares\Wokiee\Block\Template" name="product_labels" template="html/product_labels.phtml"/>
        <block class="Ecomwares\Wokiee\Block\Template" name="product_countdown" template="html/product_countdown.phtml"/>

        <move element="product.info.wrapper" destination="content" before="-" />
        <move element="product.info.media" destination="product.info.col.media"/>
        <move element="product.info.main" destination="product.info.col.main.wrap"/>
        <move element="product.info.details.bot" destination="main.content" after="main.content.indent"/>
        <move element="product_socials" destination="main.content" after="product.info.details.bot"/>
        <move element="catalog.product.related" destination="main.content" after="product_socials"/>
        <move element="product.info.upsell" destination="main.content" after="catalog.product.related"/>

        <move element="page.main.title" destination="product.info.main" before="-"/>
        <move element="product_labels" destination="product.info.main" before="-"/>
        <move element="product.info.stock.sku" destination="product.info.main" after="product.info.price"/>

        <move element="product.info.overview" destination="product.info.main" after="product-add-form"/>
        <move element="product.info.review" destination="product.info.main" after="product.info.overview"/>
        <move element="product_countdown" destination="product.info.main" after="product.info.overview"/>
        <move element="product.info.type" destination="product.info.stock.sku" after="product.info.sku"/>
        <move element="product.info.details" destination="product.info.main" after="-"/>

        <move element="product.attributes.bot" destination="product.info.details.bot"/>
        <move element="product.info.description.bot" destination="product.info.details.bot" after="product.attributes.bot"/>


    </body>
</page>
0

Change the after tab value to

after="product.info.detail" from after="-"

Change the line

block class="Magento\Cms\Block\Block" name="myPromo" after="-"

to

block class="Magento\Cms\Block\Block" name="myPromo" after="product.info.detail"
0

If you want to add the block after product description tab then use below code.

<referenceContainer name="content">
<block class="Magento\Cms\Block\Block" name="km_product_page_short_description" after="product.info.details">
<arguments>
    <argument name="block_id" xsi:type="string">km_product_page_short_description</argument>
</arguments>
</block>
</referenceContainer>
  • This displays the block above the tabs (product details) block. – user2240778 Jan 15 at 12:34
  • Try this code: <referenceContainer name="content"> <block class="Magento\Cms\Block\Block" name="km_product_page_short_description" after="-"> <arguments> <argument name="block_id" xsi:type="string">km_product_page_short_description</argument> </arguments> </block> </referenceContainer> – Mohammad Faizan Jan 15 at 12:36
  • Thanks, but that still doesnt work, show above the tabs block. – user2240778 Jan 15 at 12:57
  • <move element="product.info.details" destination="product.info.main" after="-"/> you have moved "product.info.details" in "product.info.main". you just need to pass the name of section where you want to place the "product.info.details" in after element instead of putting "-" in after. – Mohammad Faizan Jan 15 at 14:37
  • I tried everything, <block class="Magento\Cms\Block\Block" name="km_product_page_short_description" after="product.info.details"> | <block class="Magento\Cms\Block\Block" name="km_product_page_short_description" after="product.info.details.bot"> | <block class="Magento\Cms\Block\Block" name="km_product_page_short_description" after="product.info.main"> nothing moves the block after the tabs block – user2240778 Jan 15 at 15:52

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.