Git Product home page Git Product logo

magestudy's Introduction

Magestudy - Magento 2 Example extensions

Branch for Magento 2.1 - 2.3
Master branch for Magento 2.3

Installation Instruction

  • Copy the content of the repo to the Magento 2: app/code/Magestudy
  • Run command: php bin/magento setup:upgrade
  • Run Command: php bin/magento cache:flush

SimpleCrud

Shows how create simple CRUD: grid and form (ui component) without deprecated methods
Sample
Sample

ConfigExample

Sample
Shows how create and update Configuration in Magento 2 (programmatically)
Admin panel: Menu - Stores - Settings - Configuration - Magestudy example

ConsoleCommand

Shows how create console command in Magento 2
Sample
Command 1: magestudy:first_test_command
Command 2: magestudy:fullname FirstName LastName

Controller

Shows how create controller in Magento 2
Links:
yourDomain/index.php/controller/hello
yourDomain/index.php/controller/hello/world
yourDomain/index.php/controller/test
yourDomain/index.php/controller/test/check

CronExample

Shows how create Cron tasks and Cron groups in Magento 2
Result in /var/log/.debug.log: "Cron task was started at ..."

Event

Shows how use events in Magento 2
Links:
yourDomain/index.php/event/example/index
yourDomain/index.php/event/example/second

LogRepository

Shows how use repository pattern in Magento 2

Menu

Sample
Shows how create menu in Magento 2 admin panel
Admin panel: Menu - MAIN LABEL

Page

Sample
Shows how create simple page (frontend) in Magento 2
Link: http:://YOUR_SITE.domain/index.php/page/test/

Rest

Shows how create REST API in Magento 2
Links for test in \Magestudy\Rest\Model\Shop.php

UnitTestExample

Shows how create Unit test in Magento 2
In \dev\tests\unit\phpunit.xml (remove .dist if file name is phpunit.xml.dist)
Add line: ../../../app/code/Magestudy/UnitTestExample/Test/Unit
To block: testsuite
Run command in console:

  • Go to magento directory (like: cd /home/admin/web/mage23.local/public_html/dev/tests/unit)
  • Run command: php ../../../vendor/phpunit/phpunit/phpunit

Customjs

Sample
Shows how use RequireJS and Knockout.js (bindings) in Magento 2
Result in console: yourDomain/index.php/customjs/test
Frontend: yourDomain/index.php/customjs/test/simple

Crud

Admin panel: Menu - CRUD
Frontend, url: yourDomain/index.php/crud

Shows how create CRUD in Magento 2:

  • Validation;
  • Image loading;
  • Table relations;
  • UI Component;
  • Event;
  • Custom form validation;
  • Highlight rows in grid;
  • Create DB schema;
  • Admin menu;
  • Repository pattern.

PluginExample

Shows how use plugins in Magento 2
Commands for test:
magestudy:get_product
magestudy:save_product
magestudy:set_product_price
magestudy:set_product_title

Also check create new customer fom frontend and sign in.

CustomerAttribute - Customer

Sample
Sample
Shows how add new customer (custom) attribute to grid and create/edit form.

SystemCustomField

Sample
Shows how add custom fields in Stores->Settings->Configuration
Backend: Stores -> Settings -> Configuration -> Magestudy example -> Field with custom model

CustomerAccountTab

Sample
Shows how add new tab (page, menu item) in customer account (frontend).

CustomerEditButton

Sample
Shows how add new button in customer edit page (admin panel).

CustomerEditTab

Sample
Shows how add new tab\page\menu item in customer edit section (admin panel).

PaymentMethod

Sample
Shows how create new payment method in Magento 2.
Sample
Sample

ShippingMethod

Shows how create simple shipping method in Magento 2.
Sample
Sample

HideCustomerMenuItem

Shows how hide/remove menu items in (frontend) customer account page in Magento 2 (programmatically)
Sample

ProductEditButton

Shows how add button to product create/edit page in Magento 2
Sample

LoggerExample

Shows how create custom logger and write data to new file in Magento 2
Sample
Sample of injection and using here: Magestudy\LoggerExample\Helper\Data

SearchCriteria

Shows how to configure and create a SearchCriteria instance using the builder for repositories
Sample
Sample here: Magestudy\SearchCriteria\Controller\Hello\Index.php
Frontend url: .../index.php/SearchCriteria/hello/index

ExtensionAttributes

Shows how to use Extension Attributes
Sample
Frontend url: .../index.php/ExtensionAttribute/hello/index

ProductExtensionAttribute

Shows how to use Extension Attributes for products
Added sales information to product object (before test need to create order for selected product)
Sample
Frontend url: .../index.php/ProductExtensionAttribute/hello/index
Sample here: Magestudy\ProductExtensionAttribute\Controller\Hello\Index.php

Widget

Shows how create simple widget
Sample

  • Go to CONTENT -> Widgets -> Add Widget
  • Select "Magestudy Sample Widget" as type and choose your theme
  • Click on continue and fill all fields (in "Widget Options" set some data to label and limit)
  • Go to CONTENT -> Pages -> Home Page: add widget to page
  • Go to main page for result

Mixins

Shows how to use mixins in Magento 2:

  • Add new method
  • Override method
    Sample
    Frontend url: .../index.php/mixin/index

License

MIT

magestudy's People

Contributors

nans avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.