Changing a layout XML of a Magento 2 module
In order to customize the layout to your own requirements, you can just add it to your theme and make the required changes. In order to change a layout from a Magento 2 module, you will need to locate the module and layout handle that you want to alter.
Getting ready
In this recipe, we will change the order of some elements on the product view page based on the theme created in the previous recipe.
How to do it…
The following steps will show you how to change elements defined in a layout file to match your desired design:
Create the layout handle file for the
Magento_Catalog
module:app/design/frontend/Genmato/default/Magento_Catalog/layout/catalog_product_view.xml
<?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> <move element="product.info.stock.sku" destination="product.info...