Magento 2 Application Modes

This entry is part 2 of 5 in the series Magento 2 Series: Understanding the Architecture

There are 3 modes of Magento application, i.e. default (which is the default mode after install), developer, and production.

Here is the difference between them:

  1. default:

    • Not optimized for production
    • Symlinks to static view files are published to the pub/static directory
    • Errors and exceptions are not shown to the user, as they are logged to the filesystem
    • This is the default mode after install, use it if you only want to view and explore Magento. You should avoid using it in development or production environment.
  2. developer
    • Symlinks to static view files are published to the pub/static directory
    • provides verbose logging
    • Enables automatic code compilation
    • Enables enhance debugging
    • Slowest performance
  3. production
    • Errors and exception are not shown to the user, as they are logged to the filesystem
    • Static view files are not materialized, as they are served from the cache only
    • Automatic code file compilation is disabled, as new or updated files are not written to the filesystem
    • Enabling and disabling the cache types is not possible from Magento admin
    • Fastest performance

Read More

Bagaimana menggunakan tipe data varchar pada InstallSchema Magento 2?

InstallSchema pada Magento berguna saat kita ingin membuat skema tabel baru. Dalam istilah terminologi database sering disebut dengan DDL (Data Definition Language). Dengan menggunakan installer ini kita bisa membuat table dengan contoh cara berikut:

Read More

Mengubah awalan/prefix nomor order Magento

Secara default, nomor order pada Magento terdiri dari 9 digit berupa angka, misalnya 145000020. Magento tidak menyediakan pilihan konfigurasi untuk menambah awalan/prefix pada nomor order, misalnya S145000020, jadi kita harus melakukannya langsung melalui query sql.

Untuk menambah prefix order pada semua store, jalankan query berikut:

Jika anda ingin menambah prefix order hanya pada toko tertentu, jalankan query berikut:

ganti ‘kodetoko’ dengan kode store Magento anda.

Jika anda ingin membuang kembali prefix, jalankan query berikut:

Fungsi-fungsi URL pada Magento

Berikut beberapa fungsi seputar URL yang digunakan pada Magento.

GET BASE URL

Get Current URL

Get Home URL

Get secure URL
Untuk mendapat secure URL cukup menambahkan satu parameter sebagai berikut: