1

I am using a Prince_Productattach module on my Magento 2.3.3 CE, how can I troubleshoot some issues on the frontend.

  1. as the diagram shown, the product attach block display on two places, i didn't customize it, how should i find out the reason for this duplicated?

  2. The Tab for Download (attachment) on the product detail is the first at the moment, I think normal this tab better put behind, the first should be the product basic information, how can I change the order of the tab on the module?

enter image description here

Here's the layout catalog_product_view.xml, will you find anything I should adjust to do what mentioned above.

enter image description here -- catalog_product_view.xml --

-- end of catalog_product_view.xml --

2 Answers 2

1

You have to edit this layout file. See there is a referenceContainer name="alert.urls", and referenceBlock name="product.info.details". Both are using same Block Class Prince\Productattach\Block\Attachment.

referenceContainer name="alert.urls" is using for right side portion.

referenceBlock name="product.info.details" is using for tab.

You can remove or comment any section to hide any section of these two.

Remove all or . Then see the change.

Commands to run :

rm -rf pub/static/frontend

php bin/magento setup:static-content:deploy -f

php bin/magento c:c

2
  • yes, the block unwanted is comment and done. Commented Sep 5, 2022 at 12:20
  • do you know how i should change the tab order? make the product_attachment the last and inactive upon page loaded. Commented Sep 5, 2022 at 12:21
1

The productattachment block can be shown on two places by default. In the XML code you shared there's an ifconfig attribute for the block nodes which is used to determine if the block should be shown. You don't have to code for these configurations.

The configurations can be found in the admin panel inside Stores -> Configuration –> Catalog –> Product Attachment –> Configuration. The first one is named Show On Product Details, the second one is Show On Product Tab. Just disable the one you don't want to use.

Source: User Guide, available at https://marketplace.magento.com/prince-module-productattachment.html

To change the sort order of tabs you need to add an XML file to your theme applying a sortOrder value as a block argument. Add this XML file to your theme (app/design/frontend/<vendor>/<theme-code>/Mageprince_Productattach/layout/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="productattach.tab">
            <arguments>
                <argument name="sort_order" xsi:type="string">100</argument>
            </arguments>
        </referenceBlock>
    </body>
</page>

Depending on customisation you already have you may need to set a higher number.

1
  • the code of <argument> for sort_order is perfect. the path to the xml layout file may be different due to version and setup, but the code is definitely working. many thanks. Commented Sep 7, 2022 at 7:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.