{"id":15014479,"url":"https://github.com/nans/magestudy","last_synced_at":"2025-04-12T08:08:51.725Z","repository":{"id":37692702,"uuid":"95555152","full_name":"nans/Magestudy","owner":"nans","description":"Magento 2 extension samples","archived":false,"fork":false,"pushed_at":"2021-05-09T21:38:15.000Z","size":466,"stargazers_count":69,"open_issues_count":0,"forks_count":40,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-12T08:07:14.294Z","etag":null,"topics":["cron-tasks","crud","example","grid","magento-2","magento2","magento2-extension","magento2-module","phpunit","samples"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nans.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-06-27T12:19:52.000Z","updated_at":"2024-10-14T07:52:47.000Z","dependencies_parsed_at":"2022-09-15T11:22:22.773Z","dependency_job_id":null,"html_url":"https://github.com/nans/Magestudy","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/nans%2FMagestudy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nans%2FMagestudy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nans%2FMagestudy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nans%2FMagestudy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nans","download_url":"https://codeload.github.com/nans/Magestudy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248537137,"owners_count":21120709,"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":["cron-tasks","crud","example","grid","magento-2","magento2","magento2-extension","magento2-module","phpunit","samples"],"created_at":"2024-09-24T19:45:40.876Z","updated_at":"2025-04-12T08:08:51.689Z","avatar_url":"https://github.com/nans.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Magestudy - Magento 2 Example extensions  \n\nTested on version 2.3.5  \nBranch for [Magento 2.1 - 2.3](https://github.com/nans/Magestudy/tree/2.1-2.3)  \nMaster branch for Magento 2.3  \n\n## Installation Instruction  \n* Copy the content of the repo to the Magento 2: app/code/Magestudy  \n* Run command: php bin/magento setup:upgrade   \n* Run Command: php bin/magento cache:flush  \n\n(On installing on Magento 2.2 need to uncomment rows at Magestudy\\ProductExtensionAttribute\\Setup\\InstallData.php)  \n\n## SimpleCrud  \nShows how create simple CRUD: grid and form (ui component) without deprecated methods  \n![Sample](https://github.com/nans/devdocs/blob/master/Magestudy/SimpleCrudGrid.png \"SimpleCrudGrid screenshot\")  \n![Sample](https://github.com/nans/devdocs/blob/master/Magestudy/SimpleCrudForm.png \"SimpleCrudForm screenshot\")  \n\n## ConfigExample\n![Sample](https://github.com/nans/devdocs/blob/master/Magestudy/ConfigExample.png \"ConfigExample screenshot\")  \nShows how create and update Configuration in Magento 2 (programmatically)  \nAdmin panel: Menu - Stores - Settings - Configuration - Magestudy example\n\n## ConsoleCommand\nShows how create console command in Magento 2    \n![Sample](https://github.com/nans/devdocs/blob/master/Magestudy/Magestudy_Command.png \"ConsoleCommand screenshot\")  \nCommand 1: magestudy:first_test_command  \nCommand 2: magestudy:fullname FirstName LastName  \n\n## Controller\nShows how create controller in Magento 2  \nLinks:  \nyourDomain/index.php/controller/hello  \nyourDomain/index.php/controller/hello/world  \nyourDomain/index.php/controller/test  \nyourDomain/index.php/controller/test/check\n\n## CronExample  \nShows how to create Cron tasks and Cron groups in Magento 2  \nResult in /var/log/.debug.log: \"Cron task was started at ...\"  \n\nAnswer on question: How are scheduled jobs configured?  \n\n## Event  \nShows how use events in Magento 2  \n[Documentation](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/events-and-observers.html)  \n\nLinks:  \nyourDomain/index.php/event/example/index  \nyourDomain/index.php/event/example/second\n\n## LogRepository\nShows how use repository pattern in Magento 2\n\n## Menu\n![Sample](https://github.com/nans/devdocs/blob/master/Magestudy/Menu.png \"Menu screenshot\")  \nShows how create menu in Magento 2 admin panel  \nAdmin panel: Menu - MAIN LABEL\n\n## Page\n![Sample](https://github.com/nans/devdocs/blob/master/Magestudy/Page.png \"Frontend page screenshot\")  \nShows how create simple page (frontend) in Magento 2  \nLink: http:://YOUR_SITE.domain/index.php/page/test/\n\n## Rest\nShows how create REST API in Magento 2  \nLinks for test in \\Magestudy\\Rest\\Model\\Shop.php\n\n## UnitTestExample\nShows how create Unit test in Magento 2  \nIn \\dev\\tests\\unit\\phpunit.xml (remove .dist if file name is phpunit.xml.dist)  \nAdd line: \u003cdirectory suffix=\"Test.php\"\u003e../../../app/code/Magestudy/UnitTestExample/Test/Unit\u003c/directory\u003e  \nTo block: testsuite  \nRun command in console:  \n* Go to magento directory (like: cd /home/admin/web/mage23.local/public_html/dev/tests/unit)  \n* Run command: php ../../../vendor/phpunit/phpunit/phpunit  \n\n## Customjs\n![Sample](https://github.com/nans/devdocs/blob/master/Magestudy/Customjs.png \"Customjs page screenshot\")  \nShows how use RequireJS and Knockout.js (bindings) in Magento 2  \nResult in console: yourDomain/index.php/customjs/test  \nFrontend: yourDomain/index.php/customjs/test/simple\n\n## Crud\nAdmin panel: Menu - CRUD  \nFrontend, url: yourDomain/index.php/crud  \n#### Shows how create CRUD in Magento 2:\n- Validation;\n- Image loading;\n- Table relations;\n- UI Component;\n- Event;\n- Custom form validation;\n- Highlight rows in grid;\n- Create DB schema;\n- Admin menu;\n- Repository pattern.  \n\n**Note, this module contains a lot of unnecessary abstractions for Adminhtml controllers.  \nSimpleCrud extension has simple and clean controllers.**  \n\n## PluginExample\n![Sample](https://github.com/nans/devdocs/blob/master/Magestudy/PluginExample.png \"PluginExample screenshot\")  \n#### Commands for test:  \nmagestudy:get_product  \nmagestudy:save_product  \nmagestudy:set_product_price  \nmagestudy:set_product_title  \nmagestudy:set_product_image  \n###Cases:  \nLogin as customer adds next message: \"This text added before customer authenticate.\"  \nCreate new customer: \"This text added after customer create account.\"  \n\n## CustomerAttribute - Customer  \n![Sample](https://github.com/nans/devdocs/blob/master/Magestudy/CustomerAttribute_GRID.png \"CustomerAttribute screenshot\")  \n![Sample](https://github.com/nans/devdocs/blob/master/Magestudy/CustomerAttribute_FIELD.png \"CustomerAttribute screenshot\")  \nShows how add new customer (custom) attribute to grid and create/edit form.\n\n## AddCustomerAddressField    \n![Sample](https://github.com/nans/devdocs/blob/master/Magestudy/AddCustomerAddressField.png \"Customer Address Attribute screenshot\")  \nAnswer on question: How do you add another field to the customer address entity using a setup script?  \n\n## SystemCustomField  \n![Sample](https://github.com/nans/devdocs/blob/master/Magestudy/SystemCustomField.png \"SystemCustomField screenshot\")  \nShows how add custom fields in Stores-\u003eSettings-\u003eConfiguration  \nBackend: Stores -\u003e Settings -\u003e Configuration -\u003e Magestudy example -\u003e Field with custom model\n\n## CustomerAccountTab  \n![Sample](https://github.com/nans/devdocs/blob/master/Magestudy/CustomerAccountTab.png \"CustomerAccountTab screenshot\")  \nShows how add new tab (page, menu item) in customer account (frontend).    \nAnswer on question: Describe how to customize the “My Account” section. How do you add a menu item?   \n\n## CustomerEditButton  \n![Sample](https://github.com/nans/devdocs/blob/master/Magestudy/CustomerEditButton.png \"CustomerEditButton screenshot\")  \nShows how add new button in customer edit page (admin panel).    \n \n## CustomerEditTab  \n![Sample](https://github.com/nans/devdocs/blob/master/Magestudy/CustomerEditTab.png \"CustomerEditTab screenshot\")  \nShows how add new tab\\page\\menu item in customer edit section (admin panel). \n\n## PaymentMethod   \n![Sample](https://github.com/nans/devdocs/blob/master/Magestudy/PaymentMethod_Checkout.png \"PaymentMethod screenshot\")  \nShows how create new payment method in Magento 2.  \n![Sample](https://github.com/nans/devdocs/blob/master/Magestudy/PaymentMethod_Front.png \"PaymentMethod screenshot\")  \n![Sample](https://github.com/nans/devdocs/blob/master/Magestudy/PaymentMethod_Backend.png \"PaymentMethod screenshot\")  \n\n## ShippingMethod  \nShows how create simple shipping method in Magento 2.  \n![Sample](https://github.com/nans/devdocs/blob/master/Magestudy/Shipping_front.png \"ShippingMethod screenshot\")  \n![Sample](https://github.com/nans/devdocs/blob/master/Magestudy/Shipping_Config.png \"ShippingMethod screenshot\")  \n\n## HideCustomerMenuItem\nShows how hide/remove menu items in (frontend) customer account page in Magento 2 (programmatically)  \n![Sample](https://github.com/nans/devdocs/blob/master/Magestudy/customer_menu_items.png \"HideCustomerMenuItem screenshot\")\n\n## ProductEditButton\nShows how add button to product create/edit page in Magento 2  \n![Sample](https://github.com/nans/devdocs/blob/master/Magestudy/product-edit-button.png \"ProductEditButton screenshot\")\n\n## LoggerExample  \nShows how create custom logger and write data to new file in Magento 2  \n![Sample](https://github.com/nans/devdocs/blob/master/Magestudy/custom_logger.png \"LoggerExample screenshot\")  \nSample of injection and using here: Magestudy\\LoggerExample\\Helper\\Data  \n\n## SearchCriteria  \nShows how to configure and create a SearchCriteria instance using the builder for repositories  \n![Sample](https://github.com/nans/devdocs/blob/master/Magestudy/SearchCriteria.png \"SearchCriteria screenshot\")  \nSample here: Magestudy\\SearchCriteria\\Controller\\Hello\\Index.php  \nFrontend url: .../index.php/SearchCriteria/hello/index\n\n## ExtensionAttributes  \nShows how to use Extension Attributes  \n![Sample](https://github.com/nans/devdocs/blob/master/Magestudy/ExtensionAttribute.png \"ExtensionAttributes screenshot\")  \nFrontend url: .../index.php/ExtensionAttribute/hello/index\n\n## ProductExtensionAttribute\nShows how to use Extension Attributes for products  \nAdded sales information to product object (before test need to create order for selected product)   \n![Sample](https://github.com/nans/devdocs/blob/master/Magestudy/PEA_Result.png \"ProductExtensionAttribute screenshot\")  \nFrontend url: .../index.php/ProductExtensionAttribute/hello/index  \nSample here: Magestudy\\ProductExtensionAttribute\\Controller\\Hello\\Index.php  \n\n## Widget  \nShows how create simple widget  \n![Sample](https://github.com/nans/devdocs/blob/master/Magestudy/Widget.png \"Widget screenshot\")  \n* Go to CONTENT -\u003e Widgets -\u003e Add Widget\n* Select \"Magestudy Sample Widget\" as type and choose your theme\n* Click on continue and fill all fields (in \"Widget Options\" set some data to label and limit)\n* Go to CONTENT -\u003e Pages -\u003e Home Page: add widget to page\n* Go to main page for result\n\n## Mixins  \nShows how to use mixins in Magento 2:  \n* Add new method\n* Override method  \n![Sample](https://github.com/nans/devdocs/blob/master/Magestudy/Mixins.png \"Mixins screenshot\")  \nFrontend url: .../index.php/mixin/index  \n\n## CustomizeOrderHistoryPage  \n![Sample](https://github.com/nans/devdocs/blob/master/Magestudy/CustomizeOrderHistoryPage.png \"Сustomize the Order History page in Magento 2 screenshot\")  \nAnswer on question: How do you customize the order history page?  \n\n## Router  \nAn implementation of RouterInterface to create a custom router.  \n![Sample](https://github.com/nans/devdocs/blob/master/Magestudy/Router.png \"Router screenshot\")  \nFrontend url: .../index.php/sample  \n\n## Declarative Schema  \nMigrate install/upgrade scripts to declarative schema  \nDevelop data patches  \n![Sample](https://github.com/nans/devdocs/blob/master/Magestudy/DeclarativeSchema.png \"DeclarativeSchema screenshot\")  \n\n## Recently Viewed Widget field  \nAdded new field to recently viewed widget   \n![Sample](https://github.com/nans/devdocs/blob/master/Magestudy/WidgetRecentlyViewedAdmin.png \"Recently Viewed Widget screenshot\")  \n![Sample](https://github.com/nans/devdocs/blob/master/Magestudy/WidgetRecentlyViewedFront.png \"Recently Viewed admin panel screenshot\")  \n\n## Add new params to window.checkout and window.checkoutConfig  \nAdd new params to use in JS files  \n![Sample](https://github.com/nans/devdocs/blob/master/Magestudy/CheckoutConfig.png \"WindowCheckoutConfig screenshot\")  \n![Sample](https://github.com/nans/devdocs/blob/master/Magestudy/CheckoutWindowRow.png \"WindowCheckoutConfig screenshot\")  \n\n## Additional fields in the \"Shipping and Tracking Information\" section - AdditionalTrackingFields\nAdded new fields (Reference and Contents) to the tracking form.\n![Sample](https://github.com/nans/devdocs/blob/master/AdditionalTrackingFields/NewTrackingFields.png \"AdditionalTrackingFields screenshot\")\n\n## Add a new role to the product image - ProductImageRole\nAdd new product image role programmatically  \n![Sample](https://github.com/nans/devdocs/blob/master/ProductImageRole/ImageDetail.png \"ProductImageRole screenshot\")  \n![Sample](https://github.com/nans/devdocs/blob/master/ProductImageRole/ProductEditPage.png \"ProductImageRole screenshot\")\n\nLicense\n----\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnans%2Fmagestudy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnans%2Fmagestudy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnans%2Fmagestudy/lists"}