{"id":19163711,"url":"https://github.com/stnc/magento2-observer-modul","last_synced_at":"2026-06-17T15:30:19.141Z","repository":{"id":69123029,"uuid":"164417368","full_name":"stnc/magento2-observer-modul","owner":"stnc","description":null,"archived":false,"fork":false,"pushed_at":"2021-03-05T14:19:53.000Z","size":31,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-03T21:46:45.905Z","etag":null,"topics":["magento-extension","magento2","magento2-module","magento2-observers"],"latest_commit_sha":null,"homepage":null,"language":"Less","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stnc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-01-07T10:39:37.000Z","updated_at":"2023-03-05T02:44:45.000Z","dependencies_parsed_at":"2023-05-01T06:00:54.445Z","dependency_job_id":null,"html_url":"https://github.com/stnc/magento2-observer-modul","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stnc%2Fmagento2-observer-modul","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stnc%2Fmagento2-observer-modul/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stnc%2Fmagento2-observer-modul/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stnc%2Fmagento2-observer-modul/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stnc","download_url":"https://codeload.github.com/stnc/magento2-observer-modul/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240245887,"owners_count":19771029,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["magento-extension","magento2","magento2-module","magento2-observers"],"created_at":"2024-11-09T09:16:26.338Z","updated_at":"2026-06-17T15:30:19.085Z","avatar_url":"https://github.com/stnc.png","language":"Less","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Beo**n Mobile Magento Module\n\n**Magento 2 Module development** or **Magento 2 Hello World Simple Module** trends is increase rapidly while Magento release official version. That why we - **Stnc** - are wring about a topic that introduces how to create a simple **Hello World module in Magento 2**.\nAs you know, the module is a  directory that contains `blocks, controllers, models, helper`, etc - that are related to a specific business feature. In Magento 2, modules will be live in `app/code` directory of a Magento installation, with this format: `app/code/\u003cVendor\u003e/\u003cModuleName\u003e`. Now we will follow this steps to create a simple module which work on Magento 2 and display `Hello World`.\n\n\n\n## Beon Mobile Magento Module\n\n- Step 1: Create a directory for the module like above format.\n- Step 2: Declare module by using configuration file module.xml\n- Step 3: Register module by registration.php\n- Step 4: Enable the module\n- Step 5: Create a Routers for the module.\n- Step 6: Create controller and action.\n\n\n### Step 1. Create a directory for the module like above format.\n\nIn this module, we will use `Stnc` for Vendor name and `Base` for ModuleName. So we need to make this folder:\n`app/code/Stnc/Base`\n\n### Step 2. Declare module by using configuration file module.xml\n\nMagento 2 looks for configuration information for each module in that module’s etc directory. We need to create folder etc and add module.xml:\n\n~~~\napp/code/Stnc/Base/etc/module.xml\n~~~\n\nAnd the content for this file:\n\n~~~ xml\n\u003c?xml version=\"1.0\"?\u003e\n\u003cconfig xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"urn:magento:framework:Module/etc/module.xsd\"\u003e\n    \u003cmodule name=\"Stnc_Base\" setup_version=\"1.0.0\" /\u003e\n\u003c/config\u003e\n~~~\n\nIn this file, we register a module with name `Stnc_Base` and the version is `1.0.0`.\n\n### Step 3. Register module by registration.php\n\nAll Magento 2 module must be registered in the Magento system through the magento ComponentRegistrar class. This file will be placed in module root directory.\nIn this step, we need to create this file:\n\n~~~\napp/code/Stnc/Base/registration.php\n~~~\n\nAnd it’s content for our module is:\n\n~~~\n\\Magento\\Framework\\Component\\ComponentRegistrar::register(\n    \\Magento\\Framework\\Component\\ComponentRegistrar::MODULE,\n    'Stnc_Base',\n    __DIR__\n);\n~~~\n\n### Step 4. Enable the module\n\nBy finish above step, you have created an empty module. Now we will enable it in Magento environment.\nBefore enable the module, we must check to make sure Magento has recognize our module or not by enter the following at the command line:\n\n~~~\nphp bin/magento module:status\n~~~\n\nIf you follow above step, you will see this in the result:\n\n~~~\nList of disabled modules:\nStnc_Base\n~~~\n\nThis means the module has recognized by the system but it is still disabled. Run this command to enable it:\n\n~~~\nphp bin/magento module:enable Stnc_Base\n~~~\n\nThe module has enabled successfully if you saw this result:\n\n~~~\nThe following modules has been enabled:\n- Stnc_Base\n~~~\n\nThis’s the first time you enable this module so Magento require to check and upgrade module database. We need to run this comment:\n\n~~~\nphp bin/magento setup:upgrade\n~~~\n\nNow you can check under `Stores -\u003e Configuration -\u003e Advanced -\u003e Advanced` that the module is present.\n\n### Step 5. Create a Routers for the module.\n\nIn the Magento system, a request URL has the following format:\n\n~~~\nhttp://example.com/\u003crouter_name\u003e/\u003ccontroller_name\u003e/\u003caction_name\u003e\n~~~\n\nThe Router is used to assign a URL to a corresponding controller and action. In this module, we need to create a route for frontend area. So we need to add this file:\n\n~~~\napp/code/Stnc/Base/etc/frontend/routes.xml\n~~~\n\nAnd content for this file:\n\n~~~\n\u003c?xml version=\"1.0\"?\u003e\n\u003cconfig xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"urn:magento:framework:App/etc/routes.xsd\"\u003e\n    \u003crouter id=\"standard\"\u003e\n        \u003croute id=\"mageplaza\" frontName=\"Base\"\u003e\n            \u003cmodule name=\"Stnc_Base\" /\u003e\n        \u003c/route\u003e\n    \u003c/router\u003e\n\u003c/config\u003e\n~~~\n\nAfter define the route, the URL path to our module will be: `http://example.com/Base/*`\n\n### Step 6. Create controller and action.\n\nIn this step, we will create controller and action to display `Hello World`.\nNow we will choose the url for this action. Let assume that the url will be:\n`http://example.com/Base/index/display`\n\nSo the file we need to create is:\n\n~~~\napp/code/Stnc/Base/Controller/Index/Display.php\n~~~\n\nAnd we will put this content:\n\n~~~ php\n\u003c?php\nnamespace Stnc\\Base\\Controller\\Index;\n\nclass Display extends \\Magento\\Framework\\App\\Action\\Action\n{\n  public function __construct(\n\\Magento\\Framework\\App\\Action\\Context $context)\n  {\n    return parent::__construct($context);\n  }\n\n  public function execute()\n  {\n    echo 'Hello World';\n    exit;\n  }\n}\n~~~\n\n\nIf you have followed all above steps, you will see `Hello World` when open the url `http://example.com/Base/index/display`\n\n\n\n\u003cheader class=\"stnc-beon-header\"\u003e add class \n\n/app/design/frontend/Smartwave/porto/Magento_Catalog/templates/product/list.phtml\nadd class  -\u003e .stnc-cat-list\n\n\ncategori page \nstnc-cat-list\n\n\n\n//TODO thumbnail image helper a aktarılacak \n\nbu üçü block olacak bunları module aktar \n/var/www/mage2/app/design/frontend/Smartwave/porto/Magento_Catalog/templates/product/view/selman_write_review.phtml\n/var/www/mage2/app/design/frontend/Smartwave/porto/Magento_Catalog/templates/product/view/selman_write_review.phtml\n/var/www/mage2/app/design/frontend/Smartwave/porto/Magento_Catalog/templates/product/view/selman_warranty.phtml\n\n//burada 801 satır todo selman \n/var/www/mage2/app/code/Stnc/Base/view/frontend/web/css/source/_module.less\n\n\n\nhataalr \nhttp://mage2.test/shop/power.html?color=47\nload more ajax onun gorunumu güzelleşecek \nlayered navgiation sıralasmına bakılacak \nfooter da başlıklar font bold olacak \nmobiledeki header sorunları \n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstnc%2Fmagento2-observer-modul","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstnc%2Fmagento2-observer-modul","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstnc%2Fmagento2-observer-modul/lists"}