I want to show content without tabs on product detail page. Magento shows description and reviews in tab on product detail page.
Is there any way we can remove the tab and show content vertically?
Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It only takes a minute to sign up.
Sign up to join this communityI want to show content without tabs on product detail page. Magento shows description and reviews in tab on product detail page.
Is there any way we can remove the tab and show content vertically?
First remove description and review tabs from
app/design/frontend/Vendor/theme/Magento_Catalog/layout/catalog_product_view.xml
<referenceBlock name="reviews.tab" remove="true" />
<referenceBlock name="product.info.description" remove="true" />
Now you can show description, more information, review.
<?xml version="1.0"?>
<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.atributes.block" htmlTag="div" htmlClass="product-atributes-blocks" after="product.info.details">
<block class="Magento\Catalog\Block\Product\View\Attributes" name="product.attributes" as="additional" template="product/view/attributes.phtml" group="detailed_info">
<arguments>
<argument translate="true" name="title" xsi:type="string">More Information</argument>
</arguments>
</block>
<block class="Magento\Catalog\Block\Product\View\Description" name="product.info.description.full" template="product/view/attribute.phtml" group="detailed_info">
<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">Description</argument>
<argument name="title" translate="true" xsi:type="string">Details</argument>
</arguments>
</block>
</container>
</referenceContainer>
<referenceBlock name="reviews.tab" remove="true" />
<referenceBlock name="product.info.description" remove="true" />
</body>
</page>
Don't forget to flush the cache
You can use the below code in your module catalog_product_view.xml:
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceBlock name="product.info.details" remove="true"/>
<referenceBlock name="product.info.overview" remove="true"/>
<referenceBlock name="product.attributes" remove="true"/>
<referenceBlock name="reviews.tab" remove="true"/>
<referenceContainer name="content">
<block class="Magento\Catalog\Block\Product\View\Description" name="product.description" template="Magento_Catalog::product/view/details.phtml" after="product.info.media">
<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">Details</argument>
</arguments>
</block>
</referenceContainer>
</body>
</page>