I am using Luma as base for custom template. I like to know how i can move additional information attribute from tabs to under short description of product page. I have created path for custom luma and i have catalog_product_view.xml Thanks.
2 Answers
To move the additional information attribute from the tabs to under the short description of the product page in your custom Luma template, you can follow these steps:
Create a custom module or theme based on the Luma template.
Copy the file catalog_product_view.xml from the Luma theme to your custom module or theme.
Open the catalog_product_view.xml file in a text editor.
Locate the product.info.details block, which contains the tabs that display the additional information attribute.
Remove the product.info.details block and its child blocks from the catalog_product_view.xml file.
Add a new block below the product.info.main block to display the additional information attribute. You can use the following code:
<referenceContainer name="product.info.main"> <block class="Magento\Catalog\Block\Product\View\Description" name="product.info.additional" template="product/view/attributes.phtml"> <arguments> <argument name="at_call" xsi:type="string">getAdditionalData</argument> <argument name="at_code" xsi:type="string">additional_information</argument> <argument name="css_class" xsi:type="string">product-additional-info</argument> <argument name="title" translate="true" xsi:type="string">Additional Information</argument> <argument name="show_attribute_code" xsi:type="string">false</argument> </arguments> </block> </referenceContainer>
This code adds a new block named product.info.additional below the product.info.main block. The product.info.additional block uses the Description block class and the attributes.phtml template to display the additional information attribute. The at_call argument specifies the method that retrieves the additional information data, and the at_code argument specifies the attribute code for the additional information data.
- Save the catalog_product_view.xml file and refresh the product page to see the changes.
This should move the additional information attribute from the tabs to under the short description of the product page in your custom Luma template.
Thanks.
I tried that code. however, it turned out all i needed to do was to added following code to my custom category_product_view.xml
<move element="product.attributes" destination="product.info.main" after="product.info.overview"/>