0

I am trying to get some code onto the success page for a Magento store. I know that it needs to be done through a custom module but I can't even seem to get a base module to register though. I have been through countless tutorials that all explain the same thing and stating that it is extremely easy but it does not seem to be so. I have tried inside app/code (note this folder didn't even exist, I had to create it), I have also tried in Vendor. I created a base module with the two required files:

VendorName/MyModule/registration.php:

<?php \Magento\Framework\Component\ComponentRegistrar::register(
\Magento\Framework\Component\ComponentRegistrar::MODULE, 'VendorName_MyModule',
__DIR__
);

VendorName/MyModule/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="VendorName_MyModule" setup_version="0.0.1">
</config>

Then ran these commands: php bin/magento module:enable VendorName_MyModule php bin/magento setup:upgrade

I was then told that I can run this command to verify it worked: grep VendorName app/etc/config.php

but this is not returning anything indicating it is not working.

Any assistance on this would be appreciated. It is mind boggling how difficult this is, when all I am trying to do is add a few lines of code to one page.

0

You can refer this link Create a New Module

1
  • I have followed this exact tutorial and when I got to the part of checking that the module registered, it appeared to not have been. This article gives no advice for if this was not to work.
    – Xandor
    Apr 8 '21 at 1:36

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.