magento2

Topics related to magento2:

Getting started with magento2

Magento 2 is an open-source e-commerce platform designed to facilitate the common shopping cart structure for webpages. Compared to earlier versions of Magento, the 2.0 version is more streamlined and performant - eliminating problems with table locking and improving on the checkout system for guest users.

Dependency Injection

Module structure

Event and observer in magento 2

Magento 2 Commands for daily use

All the commands can be executed writting only part of them.

For example:

  • php bin/magento cache:flush can be traslated to:
    • php bin/magento c:f
    • php bin/magento ca:f
    • php bin/magento c:fl
    • php bin/magento cache:f
    • php bin/magento c:flush
    • etc.

You can write any part, and if it is not ambiguos, it will automatically know which one you want.

Custom Theme

luma theme as parent

{
    "name": "magento/luma",
    "description": "N/A",
    "require": {
        "php": "~5.5.0|~5.6.0|~7.0.0",
        "magento/theme-luma": "100.0.*",
        "magento/framework": "100.0.*"
    },
    "type": "magento2-theme",
    "version": "100.0.1",
    "license": [
        "OSL-3.0",
        "AFL-3.0"
    ],
    "autoload": {
        "files": [
            "registration.php"
        ]
    }
}

at the end

Run php bin/magento setup:upgrade this command after than below commands also needed sometimes

  • php bin/magento setup:static-content:deploy <language_pack_1> <language_pack_2> ... <language_pack_n>

    • <language_pack>: en_US nl_NL en_GB etc
  • php bin/magento cache:flush or php bin/magento cache:clean

Using Dependency Injection To Rewrite Object

Get products from database

Upgrading Magento

Optimizing Magento 2

Override i18n language pack

After create above files and directories language_package_code.csv will goes to Vendor Namespace directory

Example

/app/i18n/luma/en_us/en_US.csv

or

/app/i18n/luma/en_gb/en_GB.csv

or

/app/i18n/luma/nl_NL/nl_NL.csv

Configurable products and their variants.