skip to Main Content

I want to override magento’s core order/info.phtml.

I have copied the file from

vendor/magento/module-sales/view/frontend/templates/order/info.phtml

and place it here

app/design/frontend/Magento/luma/Magento_Sales/templates/order/info.phtml

But it is still using the old phtml file instead of new overrided file, please tell me where I did wrong?

I am using magento’s default theme Magento/luma

2

Answers


  1. You can’t override files from the Luma theme like this. And you shouldn’t, because you are attempting to hack the Luma theme, while its files are located elsewhere. Plus, it is a demo theme, not meant to create new production shops with.

    Instead, try to create a new theme under app/design/frontend, add a proper theme.xml and registration.php. Next, configure that theme from within your backend. And then try to override files there.

    Login or Signup to reply.
  2. You can override luma theme but you should have your own theme name and you have to set parent theme as luma so their properties can be overridden from your custom theme.

    Hope you know how to create custom theme , if not see the below steps try the same.

    Create a folder inside app/design/frontend/Vendorname/themename

    Example : Create vendor name as Test
    Theme name as : mytheme
    Now you need to create 3 files

    • composer.json
    • registration.php
    • theme.xml

    Inside theme.xml you can set the parent as luma like this

    <theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd">
        <title>Test mytheme</title>
        <parent>Magento/luma</parent>
        <media>
            <preview_image>media/preview.png</preview_image>
        </media>
    </theme>
    

    Once this is done you need to activate your theme from admin end and here you can override anything inside it.

    Once you activate your custom theme copy the sales folder this way

    app/design/frontend/Test/mytheme/Magento_Sales/order/info.phtml
    

    and do your changes inside it , you can see your changes in frontend.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search