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?

CodeForGood
  • 764
  • 7
  • 31

2 Answers2

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);

Sathya
  • 508
  • 3
  • 19
  • 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? – CodeForGood Jun 24 '22 at 09: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 '22 at 09:21
  • Thank you for the confirmation. – CodeForGood Jun 24 '22 at 09:33
  • Hi Dhiren, could you please have a look at the related post here https://magento.stackexchange.com/questions/358323/magento-2-4-2-unable-to-process-binding-ifnot-functionreturn-customer-fu I'm struggling to fix this for over 10 days now. I added as much information about the problem as possible. – CodeForGood Jul 27 '22 at 18:49
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.

Jasvir Singh
  • 343
  • 1
  • 11
  • Hi Dhiren, could you please have a look at the related post here https://magento.stackexchange.com/questions/358323/magento-2-4-2-unable-to-process-binding-ifnot-functionreturn-customer-fu I'm struggling to fix this for over 10 days now. I added as much information about the problem as possible. – CodeForGood Jul 27 '22 at 18:49