0

I need to override success.phtml file from module vendor/magento/module-inventory-in-store-pickup-frontend/view/frontend/templates/success.phtml

I'm not sure how to get the module name from module-inventory-in-store-pickup-frontend. Can I write something like Magento_InventoryInStorePickupFrontend in my custom theme?

2 Answers 2

1

Go to that module folder and see registration.php file. You'll see its real name. And then use it as its written there.

1
2

Override the Module changes in the Theme customization by using the Module name as a directory under the Theme vendor.

etc/module.xml

We can use either Module name as directory from etc/module.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
    <module name="Vendor_ModuleName"/>      
</config>

registration.php

Or we can use either Component name as directory from registration.php


<?php

use Magento\Framework\Component\ComponentRegistrar;

ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Vendor_ModuleName', __DIR__);
4
  • Sathya, I'm overriding it in custom theme under app/design not app/code so .xml and registration.php aren't require. Am I right? Jun 24 at 9:06
  • @CodeForGood yes, those files are not required. The files under the view directory alone can be overridden in the app/design (theme). In the app/design/vendor/ThemeName/{{ModuleName}}. That {{ModuleName}} can be taken from the respective module's module.xml file or registration.php file. :)
    – Sathya
    Jun 24 at 9:21
  • Thank you for the confirmation. Jun 24 at 9:33
  • Hi Dhiren, could you please have a look at the related post here magento.stackexchange.com/questions/358323/… I'm struggling to fix this for over 10 days now. I added as much information about the problem as possible. Jul 27 at 18:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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