0

I want to show a template just before all tabs but it's not showing.

my code on file catalog_product_view.xml :

       <referenceContainer name="product.info.detailed">
            <block before="product.info.detailed" name="srapsware_product_related" cacheable="true" template="Srapsware_RelatedProductsUpSellsCrossSells::product/list/items.phtml">
            <arguments>
            <argument name="title" xsi:type="string">Related</argument>
            <argument name="perline" xsi:type="number">6</argument>
            <argument name="maxnum" xsi:type="number">12</argument>
            </arguments>
            </block>
        </referenceContainer>
  • what is your xml file name? – Ranganathan Jan 4 at 7:26
  • @Ranganathan file name is catalog_product_view.xml – Shiv Singh Jan 4 at 7:34
0

can u please try below code :

<referenceContainer name="content">
            <block before="product.info.details" name="srapsware_product_related" cacheable="true" template="Srapsware_RelatedProductsUpSellsCrossSells::product/list/items.phtml">
                <arguments>
                    <argument name="title" xsi:type="string">Related</argument>
                    <argument name="perline" xsi:type="number">6</argument>
                    <argument name="maxnum" xsi:type="number">12</argument>
                </arguments>
            </block>
        </referenceContainer>

OR:

<referenceBlock name="product.info.details">
            <block before="-" name="srapsware_product_related" cacheable="true" template="Srapsware_RelatedProductsUpSellsCrossSells::product/list/items.phtml">
                <arguments>
                    <argument name="title" xsi:type="string">Related</argument>
                    <argument name="perline" xsi:type="number">6</argument>
                    <argument name="maxnum" xsi:type="number">12</argument>
                </arguments>
            </block>
        </referenceBlock>
| improve this answer | |
0

Try below solution, Working in my env

    <referenceContainer name="content">
        <block class="Magento\Framework\View\Element\Template" after="product.info.media" name="srapsware_product_related" cacheable="true" template="Srapsware_RelatedProductsUpSellsCrossSells::product/list/items.phtml">
            <arguments>
                <argument name="title" xsi:type="string">Related</argument>
                <argument name="perline" xsi:type="number">6</argument>
                <argument name="maxnum" xsi:type="number">12</argument>
            </arguments>
        </block>
    </referenceContainer>
| improve this answer | |
  • main is showing below main so it showing right side i am want just before tabs – Shiv Singh Jan 4 at 8:40
  • Pls check now. I have updated my answer – Ranganathan Jan 4 at 9:15
0
<referenceBlock name="product.info.details">
            <block class="Magento\Catalog\Block\Product\View" name="custom-tab" template="Magento_Catalog::file.phtml"
                   group="detailed_info">
                <arguments>
                    <argument translate="true" name="title" xsi:type="string">attributte_title</argument>
                    <argument name="sort_order" xsi:type="string">400</argument>
                </arguments>
            </block>
</referenceBlock>
| improve this answer | |

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.