Magento – Magento 2: How to override the luma default.xml

magento2theme

I wish to do some customization in luma theme (default.xml).

I just created the default.xml file as specified below but it is not taking any effect.

default.xml

Note sure is this the correct way to override the theme???

Best Answer

You must create and register a new theme:

enter image description here

You just need to create 2 files theme.xml and registration.php these are the examples for the theme in the image (Dayds). You should change that name for your own.

app/design/frontend/Dayds/default/registration.php

<?php
\Magento\Framework\Component\ComponentRegistrar::register(
    \Magento\Framework\Component\ComponentRegistrar::THEME,
    'frontend/Dayds/default',
    __DIR__
);

app/design/frontend/Dayds/default/theme.xml

<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd">
    <title>DAYDS . Default</title>
    <parent>Magento/luma</parent>
</theme>

Then go to the backend and activate your new theme for the desired store.