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:
<?php \Magento\Framework\Component\ComponentRegistrar::register( \Magento\Framework\Component\ComponentRegistrar::MODULE, 'VendorName_MyModule', __DIR__ );
<?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.