adding custom attribute to category
-
17-02-2021 - |
Question
I'm trying to add a new custom image attribute for category, following the guide here "https://webkul.com/blog/add-custom-image-attribute-category-magento-2/comment-page-1/#comment-16835"
However, after I added these files under /app/code/[vendor]/[Module]/
Then run
php bin/magento setup:di:compile
php bin/magento setup:upgrade
php bin/magento c:c c:f
but nothing shows up, and I cannot find the module on the list. Please help
Solution
You can create your own custom module wherein you can use the resources from the guide provided in a link included in your post.
Follow the steps below
registration.php
app/code/Vendor/CustomModule/registration.php
<?php
\Magento\Framework\Component\ComponentRegistrar::register(
\Magento\Framework\Component\ComponentRegistrar::MODULE,
'Vendor_CustomModule',
__DIR__
);
module.xml
app/code/Vendor/CustomModule/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_CustomModule" setup_version="1.0.0" />
</config>
Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange