Skip to content

rearrange more information & details tab in product details page in product details page

I need to change the default tab on product details to be more information tab, i make this edit in vendor, i replace this code

    <block class="MagentoCatalogBlockProductViewDetails" name="product.info.details" template="Magento_Catalog::product/view/details.phtml" after="product.info.media">
            <block  class="MagentoCatalogBlockProductViewDescription" name="product.info.description" as="description" template="Magento_Catalog::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">none</argument>
                    <argument name="title" translate="true" xsi:type="string">Details</argument>
                    <argument name="sort_order" xsi:type="string">10</argument>
                </arguments>
            </block>
             <block  class="MagentoCatalogBlockProductViewAttributes" name="product.attributes" as="additional" template="Magento_Catalog::product/view/attributes.phtml" group="detailed_info">
                <arguments>
                    <argument translate="true" name="title" xsi:type="string">More Information</argument>
                    <argument name="sort_order" xsi:type="string">20</argument>
                </arguments>
            </block>
        </block>

with this code

       <block class="MagentoCatalogBlockProductViewDetails" name="product.info.details" template="Magento_Catalog::product/view/details.phtml" after="product.info.media">

             <block  class="MagentoCatalogBlockProductViewAttributes" name="product.attributes" as="additional" template="Magento_Catalog::product/view/attributes.phtml" group="detailed_info">
                <arguments>
                    <argument translate="true" name="title" xsi:type="string">More Information</argument>
                    <argument name="sort_order" xsi:type="string">10</argument>
                </arguments>
            </block>
            <block   class="MagentoCatalogBlockProductViewDescription" name="product.info.description" as="description" template="Magento_Catalog::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">none</argument>
                    <argument name="title" translate="true" xsi:type="string">Details</argument>
                    <argument name="sort_order" xsi:type="string">20</argument>
                </arguments>
            </block>

        </block>

then i got the challange done from the vendor

then i returned the file to the default and i made a module to make the same task without any changing in the vendor

  1. Macademy/ChangeTabs/etc/module.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
    <module name="Macademy_ChangeTabs" setup_version="1.0.0" />
</config>
  1. Macademy/ChangeTabs/registration.php
 <?php
MagentoFrameworkComponentComponentRegistrar::register(
    MagentoFrameworkComponentComponentRegistrar::MODULE,
    'Macademy_ChangeTabs',
    __DIR__
);
  1. Macademy/ChangeTabs/view/frontend/page_layout/catlog_product_view.xml
  • i copied this file from vendor and make the same changes that i make in the same file in vendor :

product
itemprop=”name”

itemscope itemtype=”http://schema.org/Product”

    <referenceBlock name="breadcrumbs" template="Magento_Catalog::product/breadcrumbs.phtml">
        <arguments>
            <argument name="viewModel" xsi:type="object">MagentoCatalogViewModelProductBreadcrumbs</argument>
        </arguments>
    </referenceBlock>

    <referenceContainer name="content">
        <container name="product.info.main" htmlTag="div" htmlClass="product-info-main" before="-">
            <container name="product.info.price" label="Product info auxiliary container" htmlTag="div" htmlClass="product-info-price">
                <container name="product.info.stock.sku" label="Product auxiliary info" htmlTag="div" htmlClass="product-info-stock-sku">
                    <container name="product.info.type" before="-"/>
                    <block class="MagentoCatalogBlockProductViewDescription" name="product.info.sku" template="Magento_Catalog::product/view/attribute.phtml" after="product.info.type">
                        <arguments>
                            <argument name="at_call" xsi:type="string">getSku</argument>
                            <argument name="at_code" xsi:type="string">sku</argument>
                            <argument name="css_class" xsi:type="string">sku</argument>
                            <argument name="at_label" xsi:type="string">default</argument>
                            <argument name="add_attribute" xsi:type="string">itemprop="sku"</argument>
                        </arguments>
                    </block>
                </container>
                <block class="MagentoCatalogBlockProductView" name="product.info.review" template="Magento_Catalog::product/view/review.phtml" after="product.info.stock.sku" />
                <block class="MagentoCatalogPricingRender" name="product.price.final">
                    <arguments>
                        <argument name="price_render" xsi:type="string">product.price.render.default</argument>
                        <argument name="price_type_code" xsi:type="string">final_price</argument>
                        <argument name="zone" xsi:type="string">item_view</argument>
                    </arguments>
                </block>
            </container>
            <block class="MagentoCatalogPricingRender" name="product.price.tier" after="product.info.price">
                <arguments>
                    <argument name="price_render" xsi:type="string">product.price.render.default</argument>
                    <argument name="price_type_code" xsi:type="string">tier_price</argument>
                    <argument name="zone" xsi:type="string">item_view</argument>
                </arguments>
            </block>
            <container name="alert.urls" as="alert_urls" label="Alert Urls" after="product.price.tier"/>
            <block class="MagentoCatalogBlockProductView" name="product.info" template="Magento_Catalog::product/view/form.phtml" after="alert.urls">
                <container name="product.info.form.content" as="product_info_form_content">
                    <block class="MagentoCatalogBlockProductView" name="product.info.addtocart" as="addtocart" template="Magento_Catalog::product/view/addtocart.phtml"/>
                </container>
                <block class="MagentoFrameworkViewElementTemplate" name="product.info.form.options" as="options_container">
                    <block class="MagentoCatalogBlockProductView" name="product.info.options.wrapper" as="product_options_wrapper" template="Magento_Catalog::product/view/options/wrapper.phtml">
                        <block class="MagentoCatalogBlockProductViewOptions" name="product.info.options" as="product_options" template="Magento_Catalog::product/view/options.phtml">
                            <block class="MagentoCatalogBlockProductViewOptionsTypeDefaultType" name="product.info.options.default" as="default" template="Magento_Catalog::product/view/options/type/default.phtml"/>
                            <block class="MagentoCatalogBlockProductViewOptionsTypeText" name="product.info.options.text" as="text" template="Magento_Catalog::product/view/options/type/text.phtml"/>
                            <block class="MagentoCatalogBlockProductViewOptionsTypeFile" name="product.info.options.file" as="file" template="Magento_Catalog::product/view/options/type/file.phtml"/>
                            <block class="MagentoCatalogBlockProductViewOptionsTypeSelect" name="product.info.options.select" as="select" template="Magento_Catalog::product/view/options/type/select.phtml"/>
                            <block class="MagentoCatalogBlockProductViewOptionsTypeDate" name="product.info.options.date" as="date" template="Magento_Catalog::product/view/options/type/date.phtml"/>
                        </block>
                        <block class="MagentoFrameworkViewElementHtmlCalendar" name="html_calendar" as="html_calendar" template="Magento_Theme::js/calendar.phtml"/>
                    </block>
                    <block class="MagentoCatalogBlockProductView" name="product.info.options.wrapper.bottom" as="product_options_wrapper_bottom" template="Magento_Catalog::product/view/options/wrapper/bottom.phtml">
                        <block class="MagentoCatalogBlockProductView" name="product.info.addtocart.additional" as="product.info.addtocart" template="Magento_Catalog::product/view/addtocart.phtml"/>
                    </block>
                </block>
            </block>
            <container name="product.info.extrahint" as="extrahint" label="Product View Extra Hint">
                <container name="product.info.social" label="Product social links container" htmlTag="div" htmlClass="product-social-links">
                    <block class="MagentoCatalogBlockProductView" name="product.info.addto" as="addto" template="Magento_Catalog::product/view/addto.phtml">
                        <block class="MagentoCatalogBlockProductViewAddToCompare" name="view.addto.compare" after="view.addto.wishlist"
                               template="Magento_Catalog::product/view/addto/compare.phtml" >
                            <arguments>
                                <argument name="addToCompareViewModel" xsi:type="object">MagentoCatalogViewModelProductCheckerAddToCompareAvailability</argument>
                            </arguments>
                        </block>
                    </block>
                    <block class="MagentoCatalogBlockProductView" name="product.info.mailto" template="Magento_Catalog::product/view/mailto.phtml"/>
                </container>
            </container>
            <block class="MagentoCatalogBlockProductViewDescription" name="product.info.overview" template="Magento_Catalog::product/view/attribute.phtml" group="detailed_info" after="product.info.extrahint">
                <arguments>
                    <argument name="at_call" xsi:type="string">getShortDescription</argument>
                    <argument name="at_code" xsi:type="string">short_description</argument>
                    <argument name="css_class" xsi:type="string">overview</argument>
                    <argument name="at_label" xsi:type="string">none</argument>
                    <argument name="title" translate="true" xsi:type="string">Overview</argument>
                    <argument name="add_attribute" xsi:type="string">itemprop="description"</argument>
                </arguments>
            </block>
        </container>
        <container name="product.info.media" htmlTag="div" htmlClass="product media" after="product.info.main">
            <block class="MagentoFrameworkViewElementTemplate" name="skip_gallery_after.target" before="skip_gallery_before.wrapper" template="Magento_Theme::html/skiptarget.phtml">
                <arguments>
                    <argument name="target_id" xsi:type="string">gallery-prev-area</argument>
                </arguments>
            </block>
            <container name="skip_gallery_before.wrapper" htmlTag="div" htmlClass="action-skip-wrapper">
                <block class="MagentoFrameworkViewElementTemplate" before="product.info.media.image" name="skip_gallery_before" template="Magento_Theme::html/skip.phtml">
                    <arguments>
                        <argument name="target" xsi:type="string">gallery-next-area</argument>
                        <argument name="label" translate="true" xsi:type="string">Skip to the end of the images gallery</argument>
                    </arguments>
                </block>
            </container>
            <block class="MagentoCatalogBlockProductViewGallery" name="product.info.media.image" template="Magento_Catalog::product/view/gallery.phtml">
                <arguments>
                    <argument name="gallery_options" xsi:type="object">MagentoCatalogBlockProductViewGalleryOptions</argument>
                    <argument name="imageHelper" xsi:type="object">MagentoCatalogHelperImage</argument>
                </arguments>
            </block>
            <container name="skip_gallery_after.wrapper" htmlTag="div" htmlClass="action-skip-wrapper">
                <block class="MagentoFrameworkViewElementTemplate" after="product.info.media.image" name="skip_gallery_after" template="Magento_Theme::html/skip.phtml">
                    <arguments>
                        <argument name="target" xsi:type="string">gallery-prev-area</argument>
                        <argument name="label" translate="true" xsi:type="string">Skip to the beginning of the images gallery</argument>
                    </arguments>
                </block>
            </container>
            <block class="MagentoFrameworkViewElementTemplate" name="skip_gallery_before.target" after="skip_gallery_after.wrapper" template="Magento_Theme::html/skiptarget.phtml">
                <arguments>
                    <argument name="target_id" xsi:type="string">gallery-next-area</argument>
                </arguments>
            </block>
        </container>
        <block class="MagentoCatalogBlockProductViewDetails" name="product.info.details" template="Magento_Catalog::product/view/details.phtml" after="product.info.media">

             <block  class="MagentoCatalogBlockProductViewAttributes" name="product.attributes" as="additional" template="Magento_Catalog::product/view/attributes.phtml" group="detailed_info">
                <arguments>
                    <argument translate="true" name="title" xsi:type="string">More Information</argument>
                    <argument name="sort_order" xsi:type="string">10</argument>
                </arguments>
            </block>
            <block   class="MagentoCatalogBlockProductViewDescription" name="product.info.description" as="description" template="Magento_Catalog::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">none</argument>
                    <argument name="title" translate="true" xsi:type="string">Details</argument>
                    <argument name="sort_order" xsi:type="string">20</argument>
                </arguments>
            </block>

        </block>
        <block class="MagentoCookieBlockRequireCookie" name="require-cookie" template="Magento_Cookie::require_cookie.phtml">
            <arguments>
                <argument name="triggers" xsi:type="array">
                    <item name="compareProductLink" xsi:type="string">.action.tocompare</item>
                </argument>
            </arguments>
        </block>
    </referenceContainer>
    <referenceContainer name="content.aside">
        <block class="MagentoCatalogBlockProductProductListRelated" name="catalog.product.related" template="Magento_Catalog::product/list/items.phtml">
            <arguments>
                <argument name="type" xsi:type="string">related</argument>
                <argument name="view_model" xsi:type="object">MagentoCatalogViewModelProductListingPreparePostData</argument>
            </arguments>
            <block class="MagentoCatalogBlockProductProductListItemContainer" name="related.product.addto" as="addto">
                <block class="MagentoCatalogBlockProductProductListItemAddToCompare"
                       name="related.product.addto.compare" as="compare"
                       template="Magento_Catalog::product/list/addto/compare.phtml"/>
            </block>
        </block>
        <block class="MagentoCatalogBlockProductProductListUpsell" name="product.info.upsell" template="Magento_Catalog::product/list/items.phtml">
            <arguments>
                <argument name="type" xsi:type="string">upsell</argument>
                <argument name="view_model" xsi:type="object">MagentoCatalogViewModelProductListingPreparePostData</argument>
            </arguments>
            <block class="MagentoCatalogBlockProductProductListItemContainer" name="upsell.product.addto" as="addto">
                <block class="MagentoCatalogBlockProductProductListItemAddToCompare"
                       name="upsell.product.addto.compare" as="compare"
                       template="Magento_Catalog::product/list/addto/compare.phtml"/>
            </block>
        </block>
        <block class="MagentoCatalogBlockProductViewAdditional" name="product.info.additional" as="product_additional_data"/>
    </referenceContainer>
    <referenceBlock name="product.info.addtocart">
        <block class="MagentoCatalogBlockShortcutButtonsInCatalog" name="addtocart.shortcut.buttons"/>
    </referenceBlock>
    <referenceBlock name="product.info.addtocart.additional">
        <block class="MagentoCatalogBlockShortcutButtonsInCatalog" name="addtocart.shortcut.buttons.additional"/>
    </referenceBlock>
    <referenceContainer name="content">
        <block
                class="MagentoCatalogBlockUiProductViewCounter"
                name="product_viewed_counter"
                template="Magento_Catalog::product/view/counter.phtml"/>
    </referenceContainer>
</body>

i get that review tab is disappear, i didn’t know any reason for this problem