├── CLI-commands.md ├── README.md ├── _module.less ├── assets ├── PDFs │ ├── M2CPFED - 1. Themes _ Design Config.pdf │ ├── M2CPFED - 2. Layout XML _ Templates.pdf │ ├── M2CPFED - 3. Page Layouts _ LESS _ Deploy.pdf │ ├── M2CPFED - 4. Javascript - RequireJS _ jQuery.pdf │ ├── M2CPFED - 5. Knockout _ UI components.pdf │ └── M2CPFED - 6. Translations _ Customisations.pdf ├── debug-knockout.jpg └── luma-icons.png ├── certification ├── M2CPFED - 1. Themes _ Design Config.pdf ├── M2CPFED - 2. Layout XML _ Templates.pdf ├── M2CPFED - 3. Page Layouts _ LESS _ Deploy.pdf ├── M2CPFED - 4. Javascript - RequireJS _ jQuery.pdf ├── M2CPFED - 5. Knockout _ UI components.pdf ├── M2CPFED - 6. Translations _ Customisations.pdf └── M2_Certified_Professional_Front_End_Developer_Study_Guide.pdf ├── curly-braces-variable.md ├── gitignore ├── image-snippets ├── admin-config-dev.jpg ├── clean-vs-flush-cache.jpg ├── modes.png └── upgrade-composer.jpg ├── javascript.md ├── knockout.md ├── phtml.md ├── tips&tricks.md ├── top-must-have-magento2-extensions.md ├── ui-ux ├── button-size.jpg ├── chips.jpg ├── dialog-box.jpg ├── fab-button.jpg ├── icon-button.jpg ├── input.jpg ├── navbar.jpg ├── navbar2.jpg ├── navigation.jpg └── svtion-bar.jpg ├── widgety-m2-luma.pdf └── xml.md /CLI-commands.md: -------------------------------------------------------------------------------- 1 | # Useful Magento 2 CLI commands 2 | 3 | **Deploy Mode Functions:** 4 | ``` 5 | php bin/magento deploy:mode:show 6 | php bin/magento deploy:mode:set developer ( default | production | developer ) 7 | php bin/magento deploy:mode:set production --skip-compilation 8 | 9 | php bin/magento maintenance:disable 10 | php bin/magento maintenance:enable 11 | php bin/magento maintenance:enable --ip=192.0.0.1 --ip=192.0.0.2 (for all clients except this IPs) 12 | php bin/magento maintenance:enable --ip=none (to clear the list of IPs) 13 | ``` 14 | 15 | **CSS and JS config for development** 16 | ``` 17 | php bin/magento config:set dev/js/enable_js_bundling 0 18 | php bin/magento config:set dev/js/merge_files 0 19 | php bin/magento config:set dev/js/minify_files 0 20 | php bin/magento config:set dev/css/merge_css_files 0 21 | php bin/magento config:set dev/css/minify_files 0 22 | php bin/magento config:set dev/static/sign 0 23 | 24 | php bin/magento config:set --scope="stores" --scope-code="default" dev/js/minify_files 0 25 | ``` 26 | 27 | **Cache Operations:** 28 | ``` 29 | php bin/magento cache:status 30 | php bin/magento c:f ( cache:flush } 31 | php bin/magento c:c ( cache:clean } 32 | php bin/magento cache:disable full_page layout block_html translate 33 | ``` 34 | **Default Cache types:** 35 | ``` 36 | config 37 | layout 38 | block_html 39 | collections 40 | reflection 41 | db_ddl 42 | compiled_config 43 | eav 44 | customer_notification 45 | config_integration 46 | config_integration_api 47 | full_page 48 | config_webservice 49 | translate 50 | vertex 51 | ``` 52 | 53 | **Module oprations (check current status / disable module / enable module):** 54 | ``` 55 | php bin/magento module:status 56 | php bin/magento module:disable VENDOR_MODULENAME 57 | php bin/magento module:enable VENDOR_MODULENAME 58 | php bin/magento module:uninstall VENDOR_MODULENAME (if installed by Composer) 59 | ``` 60 | 61 | **Setup Upgrade / Setup Compile / Static Content Deploy:** 62 | ``` 63 | php -d memory_limit=2048M bin/magento setup:upgrade 64 | php -d memory_limit=2048M bin/magento setup:di:compile 65 | php -d memory_limit=2048M bin/magento setup:static-content:deploy 66 | php bin/magento setup:static-content:deploy pl_PL -f 67 | php bin/magento setup:static-content:deploy pl_PL --theme Vendor/theme --no-html-minify -f 68 | php bin/magento setup:static-content:deploy pl_PL en_US en_GB --jobs 20 69 | 70 | ``` 71 | for debug files generation in developer mode: 72 | ``` 73 | php bin/magento setup:static-content:deploy -v 74 | php bin/magento setup:static-content:deploy -vv 75 | php bin/magento setup:static-content:deploy -vvv 76 | ``` 77 | 78 | **Setup config:** 79 | ``` 80 | php bin/magento setup:store-config:set --base-url="http://project.dev/" 81 | php bin/magento setup:store-config:set --base-url-secure="https://project.dev/" 82 | 83 | php bin/magento config:set admin/security/session_lifetime 604800 ( 86400 = 1 day / 604800 = 7 days / 31536000 = 1 year / etc ) 84 | php bin/magento config:set admin/security/password_is_forced 0 85 | ``` 86 | 87 | **Indexer ( Reindex | Reset ):** 88 | ``` 89 | php bin/magento indexer:reset 90 | php -d memory_limit=2048M bin/magento indexer:reindex 91 | 92 | php bin/magento indexer:status 93 | php bin/magento indexer:reset cataloginventory_stock 94 | php bin/magento indexer:reindex cataloginventory_stock 95 | ``` 96 | 97 | **Generate a translation package for a definite module** 98 | ``` 99 | php bin/magento i18n:collect-phrases --output="app/code/Module/Vendor/i18n/pl_PL.csv" app/code/Module/Vendor 100 | php bin/magento i18n:collect-phrases --output="app/design/frontend//Module/Vendor/i18n/pl_PL.csv" --magento (This option adds themes or modules to each line in the dictionary.) 101 | ``` 102 | 103 | **Catalog Images Resize:** 104 | ``` 105 | php bin/magento catalog:image:resize 106 | ``` 107 | 108 | **For admin** 109 | ``` 110 | php bin/magento admin:user:create 111 | php bin/magento config:set admin/security/password_lifetime 0 112 | php bin/magento config:set admin/security/password_is_forced 0 113 | php bin/magento info:adminuri 114 | php bin/magento admin:user:unlock USERNAME 115 | ``` 116 | 117 | **Get list of all available commands** 118 | ``` 119 | php bin/magento list 120 | php bin/magento help 121 | ``` 122 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # My Magento 2 awesome resources :star_struck: 2 | 3 | ### :point_right: My [XML snippets](https://github.com/jq91/magento2-handy-snippets/blob/master/xml.md) 4 | ### :point_right: My [.phtml template snippets](https://github.com/jq91/magento2-handy-snippets/blob/master/phtml.md) 5 | ### :point_right: My [_module.less base file](https://github.com/jq91/magento2-handy-snippets/blob/master/_module.less) 6 | ### :point_right: My [javascript snippets](https://github.com/jq91/magento2-handy-snippets/blob/master/javascript.md) 7 | ### :point_right: My [Knockout snippets](https://github.com/jq91/magento2-handy-snippets/blob/master/knockout.md) 8 | ### :point_right: My [{{variable}} snippets list](https://github.com/jq91/magento2-handy-snippets/blob/master/curly-braces-variable.md) 9 | ### :point_right: My [CLI - command line list](https://github.com/jq91/magento2-handy-snippets/blob/master/CLI-commands.md) 10 | ### :point_right: My [theme Azkarra for Magento 2.x - optimized for Core Web Vitals and SEO](https://github.com/dev-jq/Azkarra-Magento2-Theme-for-Core-Web-Vitals-and-SEO) 11 | ### :point_right: My [local developement environment for Magento 2 based on Lando and WSL2](https://github.com/dev-jq/magento2-lando-wsl2) 12 | ### :point_right: My [recommendations for Magento 2 FREE & PAID modules](https://github.com/jq91/magento2-handy-snippets/blob/master/top-must-have-magento2-extensions.md) 13 | ### :point_right: My [impoved Polish Language Pack for Magento 2.x](https://github.com/jq91/magento2-improved-polish-language-pack) 14 | ### :point_right: My [polish translations for 3rd party modules](https://github.com/dev-jq/magento2-pl-translations-for-3rd-party-modules) 15 | ### :point_right: My [Tips & Tricks](https://github.com/jq91/magento2-handy-snippets/blob/master/tips%26tricks.md) 16 | ### :point_right: Preparation for Magento certification - [PDFs](https://github.com/jq91/magento2-handy-snippets/tree/master/certification) 17 | ### :point_right: Best practice [.gitignore file ](https://github.com/jq91/magento2-handy-snippets/blob/master/gitignore) by @jissereitsma 18 | ### :point_right: Magento 2 supported [software versions compatibility](https://github.com/dev-jq/magento2-versions-compatibility) 19 | 20 | # Or see my Magento 2 bookmarks :star_struck: 21 | 22 | ## :trophy: Pro Magento Devs: 23 | :black_medium_small_square: [mage2pro](https://github.com/mage2pro) 24 | 25 | :black_medium_small_square: [magefan](https://github.com/magefan) 26 | 27 | :black_medium_small_square: [MagePsycho](https://github.com/MagePsycho) 28 | 29 | :black_medium_small_square: [redchamps](https://github.com/redchamps) 30 | 31 | :black_medium_small_square: [vijayrami](https://github.com/vijayrami) 32 | 33 | :black_medium_small_square: [nans](https://github.com/nans) 34 | 35 | :black_medium_small_square: [DominicWatts](https://github.com/DominicWatts) 36 | 37 | 38 | ## :man_student: Certification: 39 | 40 | :black_medium_small_square: [Quizes: front-end developer certification practiceexam](https://www.goconqr.com/p/15702242/question/8855829-magento-2-front-end-developer-certification-practice-exam-quizzes) :star: 41 | 42 | :black_medium_small_square: [Training PDFs resources](https://github.com/fisheye-academy/m2cpfed-training) :star: 43 | 44 | :black_medium_small_square: [goconqr.com/en/tags/magento+2](https://www.goconqr.com/en/tags/magento+2) 45 | 46 | :black_medium_small_square: [firebearstudio: How to Pass the Magento 2 Certification](https://firebearstudio.com/blog/how-to-pass-the-magento-2-certification.html) 47 | 48 | 49 | ## :writing_hand: Blogs: 50 | 51 | :black_medium_small_square: [aureatelabs.com](https://aureatelabs.com/blog/tag/magento-2/) :star: 52 | 53 | :black_medium_small_square: [dhairvi.com](https://www.dhairvi.com/category/magento2/) :star: 54 | 55 | :black_medium_small_square: [rakeshjesadiya.com](https://www.rakeshjesadiya.com/category/magento-2/) 56 | 57 | :black_medium_small_square: [magezon.com](https://blog.magezon.com/magento-tips-and-news/magento-2-tutorials/) :star: 58 | 59 | :black_medium_small_square: [magevision.com](https://www.magevision.com/blog) 60 | 61 | :black_medium_small_square: [webguru.pt](https://webguru.pt/category/magento-2/) 62 | 63 | :black_medium_small_square: [vijaymrami.blogspot.com](http://vijaymrami.blogspot.com) :star: 64 | 65 | :black_medium_small_square: [extensionsninjas.com](https://extensionsninjas.com/magento-2-tutorials.html) 66 | 67 | :black_medium_small_square: [mageprince.com](https://mageprince.com/blog/category/magento2/) :star: 68 | 69 | :black_medium_small_square: [jason.codes](https://jason.codes) 70 | 71 | :black_medium_small_square: [inchoo.net](https://inchoo.net/magento-2/) 72 | 73 | :black_medium_small_square: [codextblog.com](https://www.codextblog.com/category/magento-2/) :star: 74 | 75 | :black_medium_small_square: [meetanshi.com](https://meetanshi.com/blog/) :star: 76 | 77 | :black_medium_small_square: [webkul.com](https://webkul.com/blog/dev/) :star: 78 | 79 | :black_medium_small_square: [magefan.com](https://magefan.com/blog/magento-2-development) 80 | 81 | :black_medium_small_square: [magecomp.com](https://magecomp.com/blog/category/magento-2/) :star: 82 | 83 | :black_medium_small_square: [alanstorm.com](https://alanstorm.com/category/magento-2/) 84 | 85 | :black_medium_small_square: [chapagain.com](https://blog.chapagain.com.np/category/magento/magento-2/) :star: 86 | 87 | :black_medium_small_square: [scommerce-mage.com](https://www.scommerce-mage.com/blog/) 88 | 89 | :black_medium_small_square: [fooman.com](https://fooman.com/blog/tag:Magento2) 90 | 91 | :black_medium_small_square: [firebearstudio.com](https://firebearstudio.com/blog/the-ultimate-magento-2-tutorial.html) 92 | 93 | :black_medium_small_square: [michiel-gerritsen.com](https://www.michiel-gerritsen.com/) 94 | 95 | :black_medium_small_square: [pandagroup.co](https://pandagroup.co/blog/category/dev-notes) 96 | 97 | :black_medium_small_square: [qaisarsatti.com](https://blog.qaisarsatti.com/magento_2/) 98 | 99 | :black_medium_small_square: [magenest.com](https://store.magenest.com/blog/technical-guidelines/) :star: 100 | 101 | :black_medium_small_square: [mobecls.com](https://mobecls.com/category/magento-development/) 102 | 103 | :black_medium_small_square: [onilab.com](https://onilab.com/blog/) 104 | 105 | :black_medium_small_square: [mage.training](https://mage.training/blog/tag/magento-2/) 106 | 107 | :black_medium_small_square: [bsscommerce.com](https://bsscommerce.com/blog/category/magento-tutorial/) 108 | 109 | :black_medium_small_square: [magebrew.com](https://magebrew.com/blog/category/magento-2/) 110 | 111 | :black_medium_small_square: [wishusucess.com](http://www.wishusucess.com/category/e-commerce-platform/magento-2-ecommerce/) 112 | 113 | :black_medium_small_square: [codedecorator.com](https://www.codedecorator.com/blog) :star: 114 | 115 | :black_medium_small_square: [justwebdevelopment.com](https://www.justwebdevelopment.com/blog/category/magento2/) 116 | 117 | :black_medium_small_square: [rohanhapani.com](https://www.rohanhapani.com/category/magento/magento-2/) 118 | 119 | :black_medium_small_square: [shahednasser.com](https://blog.shahednasser.com/tag/magento) 120 | 121 | :black_medium_small_square: [M.academy](https://m.academy/blog/) 122 | 123 | :black_medium_small_square: [aureatelabs.com](https://aureatelabs.com/category/magento-2/) 124 | 125 | :black_medium_small_square: [blog.magepsycho.com](https://blog.magepsycho.com) :star: 126 | 127 | :black_medium_small_square: [olegnax.com](https://olegnax.com/category/magento-2/) 128 | 129 | :black_medium_small_square: [tigren.com](https://www.tigren.com/blog/) 130 | 131 | ## :office: Companies: 132 | 133 | :black_medium_small_square: https://github.com/orgs/swissup/repositories 134 | 135 | :black_medium_small_square: https://github.com/orgs/magepow/repositories 136 | 137 | :black_medium_small_square: https://github.com/orgs/magepal/repositories 138 | 139 | :black_medium_small_square: https://github.com/orgs/magespecialist/repositories 140 | 141 | :black_medium_small_square: https://github.com/orgs/magesuite/repositories 142 | 143 | :black_medium_small_square: https://github.com/orgs/Vendic/repositories 144 | 145 | :black_medium_small_square: https://github.com/orgs/yireo-training/repositories :star: 146 | 147 | :black_medium_small_square: https://github.com/orgs/Smile-SA/repositories 148 | 149 | :black_medium_small_square: https://github.com/orgs/EaDesgin/repositories 150 | 151 | :black_medium_small_square: https://github.com/orgs/extdn/repositories 152 | 153 | :black_medium_small_square: https://github.com/orgs/integer-net/repositories 154 | 155 | :black_medium_small_square: https://github.com/orgs/AmpersandHQ/repositories 156 | 157 | :black_medium_small_square: https://github.com/orgs/magento-hackathon/repositories 158 | 159 | :black_medium_small_square: https://github.com/orgs/elgentos/repositories 160 | 161 | :black_medium_small_square: https://github.com/orgs/Siteation/repositories 162 | 163 | :black_medium_small_square: https://github.com/orgs/mage2pro/repositories 164 | 165 | :black_medium_small_square: https://github.com/orgs/bitExpert/repositories 166 | 167 | :black_medium_small_square: https://github.com/orgs/EcomDev/repositories 168 | 169 | :black_medium_small_square: https://github.com/orgs/mavenecommerce/repositories 170 | 171 | :black_medium_small_square: https://github.com/orgs/dnafactory/repositories 172 | 173 | :black_medium_small_square: https://github.com/orgs/sitewards/repositories 174 | 175 | :black_medium_small_square: https://github.com/orgs/customgento/repositories 176 | 177 | :black_medium_small_square: https://github.com/orgs/flancer32/repositories 178 | 179 | :black_medium_small_square: https://github.com/orgs/lizardmedia/repositories 180 | 181 | :black_medium_small_square: https://github.com/orgs/Magenerds/repositories 182 | 183 | :black_medium_small_square: https://github.com/AmastyLtd-zz?tab=repositories 184 | 185 | :black_medium_small_square: https://github.com/orgs/experius/repositories 186 | 187 | :black_medium_small_square: https://github.com/orgs/magemojo/repositories 188 | 189 | :black_medium_small_square: https://github.com/orgs/ebizmarts/repositories 190 | 191 | :black_medium_small_square: https://github.com/orgs/stenikgroup/repositories 192 | 193 | :black_medium_small_square: https://github.com/orgs/hungersoft/repositories 194 | 195 | :black_medium_small_square: https://github.com/orgs/bitbull-team/repositories 196 | 197 | :black_medium_small_square: https://github.com/orgs/comwrap/repositories 198 | 199 | :black_medium_small_square: https://github.com/orgs/Sebwite/repositories 200 | 201 | :black_medium_small_square: https://github.com/orgs/weprovide/repositories 202 | 203 | 204 | ## :free: Free M2 modules (companies): 205 | 206 | :black_medium_small_square: https://www.magezon.com/magento-2-extensions/free-extensions.html 207 | 208 | :black_medium_small_square: https://bsscommerce.com/magento-2-extensions/free.html 209 | 210 | :black_medium_small_square: https://www.weltpixel.com/magento2-extensions.html#wpx-free-extensions 211 | 212 | :black_medium_small_square: https://meetanshi.com/free-magento-extensions.html 213 | 214 | :black_medium_small_square: https://www.magevision.com/free-extensions 215 | 216 | :black_medium_small_square: https://amasty.com/free-magento-2-extensions.html 217 | 218 | :black_medium_small_square: https://www.ulmod.com/magento2-extensions/free-extensions.html 219 | 220 | :black_medium_small_square: https://www.codedecorator.com/freebies.html 221 | 222 | :black_medium_small_square: https://www.bubbleshop.net/magento-extensions/free.html 223 | 224 | :black_medium_small_square: https://magecomp.com/free-magento-extensions.html 225 | 226 | :black_medium_small_square: https://www.tigren.com/magento-2-extensions 227 | 228 | 229 | ## :rocket: other Magento lists: 230 | 231 | :black_medium_small_square: [@liuosio star list](https://github.com/stars/aliuosio/lists/magento) 232 | 233 | :black_medium_small_square: [@GrimLink list "magento-stuff-i-like"](https://github.com/stars/GrimLink/lists/magento-stuff-i-like) 234 | 235 | ## :rocket: Find more on GitHub: 236 | :black_medium_small_square: [Topic: Magento 2](https://github.com/topics/magento2) 237 | 238 | :black_medium_small_square: [Search for: Magento 2 Certified Developers](https://github.com/search?o=desc&q=Magento+2+Certified+Developer&s=&type=Users) 239 | -------------------------------------------------------------------------------- /_module.less: -------------------------------------------------------------------------------- 1 | // media all (styles-m.css) 2 | & when (@media-common = true) { 3 | 4 | } 5 | 6 | // only mobile-small: maximum 479px 7 | .media-width(@extremum, @break) when (@extremum = 'max') and (@break = @screen__xs) { 8 | 9 | } 10 | 11 | // only mobile-all: maximum 767px 12 | .media-width(@extremum, @break) when (@extremum = 'max') and (@break = @screen__m) { 13 | 14 | } 15 | 16 | // minimum 768px 17 | .media-width(@extremum, @break) when (@extremum = 'min') and (@break = @screen__m) { 18 | 19 | } 20 | 21 | // minimum 1024px 22 | .media-width(@extremum, @break) when (@extremum = 'min') and (@break = @screen__l) { 23 | 24 | } 25 | 26 | // minimum 1440px 27 | .media-width(@extremum, @break) when (@extremum = 'min') and (@break = @screen__xl) { 28 | 29 | } 30 | 31 | // non-mobile breakpoint in media all (styles-m.css) 32 | & when (@media-common = true) { 33 | 34 | // custom: maximum 1023px 35 | @media screen and (max-width: @screen__l) { 36 | 37 | } 38 | 39 | } 40 | 41 | // media large (styles-l.css) 42 | & when (@media-common = false) { 43 | 44 | // e.g. non-standard Magento breakpoint 45 | @media screen and (min-width: 1200px) { 46 | 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /assets/PDFs/M2CPFED - 1. Themes _ Design Config.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dev-jq/magento2-handy-snippets/f809227141c1cf5350ec8f5703f384f6758ed99e/assets/PDFs/M2CPFED - 1. Themes _ Design Config.pdf -------------------------------------------------------------------------------- /assets/PDFs/M2CPFED - 2. Layout XML _ Templates.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dev-jq/magento2-handy-snippets/f809227141c1cf5350ec8f5703f384f6758ed99e/assets/PDFs/M2CPFED - 2. Layout XML _ Templates.pdf -------------------------------------------------------------------------------- /assets/PDFs/M2CPFED - 3. Page Layouts _ LESS _ Deploy.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dev-jq/magento2-handy-snippets/f809227141c1cf5350ec8f5703f384f6758ed99e/assets/PDFs/M2CPFED - 3. Page Layouts _ LESS _ Deploy.pdf -------------------------------------------------------------------------------- /assets/PDFs/M2CPFED - 4. Javascript - RequireJS _ jQuery.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dev-jq/magento2-handy-snippets/f809227141c1cf5350ec8f5703f384f6758ed99e/assets/PDFs/M2CPFED - 4. Javascript - RequireJS _ jQuery.pdf -------------------------------------------------------------------------------- /assets/PDFs/M2CPFED - 5. Knockout _ UI components.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dev-jq/magento2-handy-snippets/f809227141c1cf5350ec8f5703f384f6758ed99e/assets/PDFs/M2CPFED - 5. Knockout _ UI components.pdf -------------------------------------------------------------------------------- /assets/PDFs/M2CPFED - 6. Translations _ Customisations.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dev-jq/magento2-handy-snippets/f809227141c1cf5350ec8f5703f384f6758ed99e/assets/PDFs/M2CPFED - 6. Translations _ Customisations.pdf -------------------------------------------------------------------------------- /assets/debug-knockout.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dev-jq/magento2-handy-snippets/f809227141c1cf5350ec8f5703f384f6758ed99e/assets/debug-knockout.jpg -------------------------------------------------------------------------------- /assets/luma-icons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dev-jq/magento2-handy-snippets/f809227141c1cf5350ec8f5703f384f6758ed99e/assets/luma-icons.png -------------------------------------------------------------------------------- /certification/M2CPFED - 1. Themes _ Design Config.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dev-jq/magento2-handy-snippets/f809227141c1cf5350ec8f5703f384f6758ed99e/certification/M2CPFED - 1. Themes _ Design Config.pdf -------------------------------------------------------------------------------- /certification/M2CPFED - 2. Layout XML _ Templates.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dev-jq/magento2-handy-snippets/f809227141c1cf5350ec8f5703f384f6758ed99e/certification/M2CPFED - 2. Layout XML _ Templates.pdf -------------------------------------------------------------------------------- /certification/M2CPFED - 3. Page Layouts _ LESS _ Deploy.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dev-jq/magento2-handy-snippets/f809227141c1cf5350ec8f5703f384f6758ed99e/certification/M2CPFED - 3. Page Layouts _ LESS _ Deploy.pdf -------------------------------------------------------------------------------- /certification/M2CPFED - 4. Javascript - RequireJS _ jQuery.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dev-jq/magento2-handy-snippets/f809227141c1cf5350ec8f5703f384f6758ed99e/certification/M2CPFED - 4. Javascript - RequireJS _ jQuery.pdf -------------------------------------------------------------------------------- /certification/M2CPFED - 5. Knockout _ UI components.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dev-jq/magento2-handy-snippets/f809227141c1cf5350ec8f5703f384f6758ed99e/certification/M2CPFED - 5. Knockout _ UI components.pdf -------------------------------------------------------------------------------- /certification/M2CPFED - 6. Translations _ Customisations.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dev-jq/magento2-handy-snippets/f809227141c1cf5350ec8f5703f384f6758ed99e/certification/M2CPFED - 6. Translations _ Customisations.pdf -------------------------------------------------------------------------------- /certification/M2_Certified_Professional_Front_End_Developer_Study_Guide.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dev-jq/magento2-handy-snippets/f809227141c1cf5350ec8f5703f384f6758ed99e/certification/M2_Certified_Professional_Front_End_Developer_Study_Guide.pdf -------------------------------------------------------------------------------- /curly-braces-variable.md: -------------------------------------------------------------------------------- 1 | ## Custom Variable 2 | `{{CustomVar code='my_custom_variable'}}` 3 | 4 | ## Store URL 5 | `{{store url='customer/account'}}` - with slash at the end 6 | 7 | `{{store direct_url='contact-us'}}` - without slash at the end 8 | 9 | ## Media URL 10 | `{{media url='wysiwyg/your-image.jpg'}}` 11 | `{{view url='images/logo.svg'}}` 12 | `{{view url='Magento_Theme::images/logo.svg'}}` 13 | 14 | ## Block ID 15 | `{{block class="Magento\Cms\Block\Block" block_id="block_identifier"}}` 16 | 17 | `{{block class="Magento\Framework\View\Element\Template" name="custom.template.block" template="Magento_Cms::custom.phtml"}}` 18 | 19 | `{{block class="Magento\Contact\Block\ContactForm" name="contactForm" template="Magento_Contact::form.phtml"}}` 20 | 21 | `{{block type="catalog/product_list" category_id="22" template="catalog/product/list.phtml"}}` 22 | 23 | ## Widget 24 | `{{widget type="Magento\Cms\Block\Widget\Block" template="widget/static_block/default.phtml" block_id="10"}}` 25 | 26 | `{{widget type="catalog/product_widget_new" display_type="new_products" products_count="10" template="catalog/product/widget/new/content/new_grid.phtml"}}` 27 | 28 | `{{widget type="catalog/product_widget_link" anchor_text="My Product Link" title="My Product Link" template="catalog/product/widgetlink/link_block.phtml" id_path="product/31"}}` 29 | 30 | ## Store Contact Information Variables 31 | Base Secure URL `{{config path='web/secure/base_url'}}` 32 | 33 | General Contact Email `{{config path='trans_email/ident_general/email'}}` 34 | 35 | ## New Account Template Variables 36 | Customer Account URL `{{var this.getUrl($store, ‘customer/account/’)}}` 37 | 38 | Customer Email `{{var customer.email}}` 39 | 40 | ## New Order Template Variables 41 | Order ID `{{var order.increment_id}}` 42 | 43 | Payment Details `{{var payment_html|raw}}` 44 | 45 | Shipping Description `{{var order.getShippingDescription()}}` 46 | 47 | ## Email Template Variables 48 | Email Logo Image URL `{{var logo_url}}` 49 | 50 | Email Logo Image Width `{{var logo_width}}` 51 | 52 | ``` 53 | – For registration: 54 | {{var customer}} 55 | 56 | {{var customer.ID}} 57 | 58 | {{var customer.email}} 59 | 60 | {{var customer.firstname}} 61 | 62 | {{var customer.lastname}} 63 | 64 | {{var customer.name}} 65 | 66 | {{var customer.password}} 67 | 68 | {{var customer.created_in}} Store Name 69 | 70 | {{var customer.dob}} Date of Birth 71 | 72 | {{var customer.password_hash}} 73 | 74 | {{var customer.prefix}} 75 | 76 | {{var customer.middlename}} Initial 77 | 78 | {{var customer.suffix}} 79 | 80 | {{var customer.group_id}} 81 | 82 | {{var customer.taxvat}} 83 | 84 | {{var customer.store.name}} 85 | 86 | {{var customer.store.group.name}} 87 | 88 | – To subscribe/unsubscribe newsletter: 89 | 90 | {{var subscriber.getConfirmationLink()}} 91 | 92 | {{var subscriber.getUnsubscriptionLink()}} 93 | 94 | {{var subscriber.email}} 95 | 96 | – Send to a friend: 97 | 98 | {{var product_image}} 99 | 100 | {{var name}} Recipient’s Name 101 | 102 | {{var email}} Recipient’s Email 103 | 104 | {{var product_name}} Product Name 105 | 106 | {{var product_url}} Product Url 107 | 108 | {{var message}} Message Text 109 | 110 | {{var sender_name}} Sender’s Name 111 | 112 | {{var sender_email}} Sender’s Email 113 | 114 | {{var product_image}} Product Image 115 | 116 | – Depend Condition 117 | 118 | {{depend order.getIsNotVirtual()}} 119 | 120 | {{/depend}} 121 | 122 | {{depend salable}} 123 | 124 | {{/depend}} 125 | 126 | – If Condition 127 | 128 | {{if order.getIsNotVirtual()}} 129 | 130 | {{else}} 131 | 132 | {{/if}} 133 | 134 | (else is optional) 135 | 136 | 137 | – New order : Shipping Address 138 | 139 | {{var order.getShippingAddress().format(‘html’)}} 140 | 141 | Items of the shipping address : 142 | 143 | {{var order.getShippingAddress().getName()}} Get the first and last name 144 | 145 | {{var order.getShippingAddress().getPrefix()}} 146 | 147 | {{var order.getShippingAddress().getFirstName()}} 148 | 149 | {{var order.getShippingAddress().getMiddleName()}} 150 | 151 | {{var order.getShippingAddress().getLastName()}} 152 | 153 | {{var order.getShippingAddress().getSuffix()}} 154 | 155 | {{var order.getShippingAddress().getStreet1()}} 156 | 157 | {{var order.getShippingAddress().getStreet2()}} 158 | 159 | {{var order.getShippingAddress().getCity()}} 160 | 161 | {{var order.getShippingAddress().getRegion()}} 162 | 163 | {{var order.getShippingAddress().getPostcode()}} 164 | 165 | {{var order.getShippingAddress().getCountry()}} Get the country’s ID 166 | 167 | {{var order.getShippingAddress().getCountryModel().getName()}} Get the country’s full name 168 | 169 | {{var order.getShippingAddress().getRegion()}} 170 | 171 | {{var order.getShippingAddress().getTelephone()}} 172 | 173 | – Other 174 | 175 | {{var addAllLink}} 176 | 177 | {{var alertGrid}} 178 | 179 | {{var billingAddress.format(‘html’)}} 180 | 181 | {{var checkoutType}} 182 | 183 | {{var comment}} 184 | 185 | {{var creditmemo.id}} 186 | 187 | {{var creditmemo.increment_id}} 188 | 189 | {{var data.comment}} 190 | 191 | {{var data.email}} 192 | 193 | {{var data.name}} 194 | 195 | {{var data.telephone}} 196 | 197 | {{var dateAndTime}} 198 | 199 | {{var invoice.id}} 200 | 201 | {{var invoice.increment_id}} 202 | 203 | {{var invoice.created_at}} 204 | 205 | {{var items}} 206 | 207 | {{var items_html}} 208 | 209 | {{var message}} 210 | 211 | {{var name}} 212 | 213 | {{var order.customer_email}} 214 | 215 | {{var order.getBillingAddress().format(‘html’)}} 216 | 217 | {{var order.getBillingAddress().getName()}} 218 | 219 | {{var order.getCreatedAtFormated(‘long’)}} 220 | 221 | {{var order.getCustomerName()}} 222 | 223 | {{var order.getCustomerFirstname()}} 224 | 225 | {{var order.getCustomerLastname()}} 226 | 227 | {{var order.getEmailCustomerNote()}} Currently unknwon how to test this variable for being set/empty 228 | 229 | {{var order.getShippingDescription()}} 230 | 231 | {{var order.getStatusLabel()}} 232 | 233 | {{var order.getStoreGroupName()}} 234 | 235 | {{var order.id}} 236 | 237 | {{var order.increment_id}} 238 | 239 | {{var password}} 240 | 241 | {{var payment_html}} 242 | 243 | {{var paymentMethod}} 244 | 245 | {{var product_name}} 246 | 247 | {{var product_url}} 248 | 249 | {{var reason}} Reason for payment failure 250 | 251 | {{var shipment.increment_id}} 252 | 253 | {{var shippingAddress.format(‘html’)}} 254 | 255 | {{var shippingMethod}} 256 | 257 | {{var total}} 258 | 259 | {{var user.name}} 260 | 261 | {{var viewOnSiteLink}} 262 | 263 | {{var warnings}} 264 | 265 | {{var billing.name}} 266 | ``` 267 | 268 | # See more: https://docs.magento.com/user-guide/marketing/variables-reference.html 269 | -------------------------------------------------------------------------------- /gitignore: -------------------------------------------------------------------------------- 1 | /.buildpath 2 | /.cache 3 | /.metadata 4 | /.project 5 | /.settings 6 | /.vscode 7 | atlassian* 8 | /nbproject 9 | /robots.txt 10 | /pub/robots.txt 11 | /.idea 12 | /.gitattributes 13 | /node_modules 14 | /.grunt 15 | /.php_cs 16 | /.php_cs.dist 17 | /.php_cs.cache 18 | .DS_Store 19 | 20 | /bin/magento 21 | /bin/.htaccess 22 | /lib 23 | /phpserver 24 | /setup 25 | /sitemap 26 | /sitemap.xml 27 | /pub/sitemap 28 | /pub/sitemap.xml 29 | /app/.htaccess 30 | /app/config_sandbox 31 | /app/autoload.php 32 | /app/bootstrap.php 33 | /app/functions.php 34 | /app/etc/env.php 35 | /app/etc/NonComposerComponentRegistration.php 36 | /app/etc/di.xml 37 | /app/etc/vendor_path.php 38 | /app/code/Magento/TestModule* 39 | /lib/internal/flex/uploader/.actionScriptProperties 40 | /lib/internal/flex/uploader/.flexProperties 41 | /lib/internal/flex/uploader/.project 42 | /lib/internal/flex/uploader/.settings 43 | /lib/internal/flex/varien/.actionScriptProperties 44 | /lib/internal/flex/varien/.flexLibProperties 45 | /lib/internal/flex/varien/.project 46 | /lib/internal/flex/varien/.settings 47 | 48 | /pub/index.php 49 | /pub/cron.php 50 | /pub/get.php 51 | /pub/media/*.* 52 | !/pub/media/.htaccess 53 | /pub/media/attribute/* 54 | !/pub/media/attribute/.htaccess 55 | /pub/media/analytics/* 56 | /pub/media/catalog/* 57 | !/pub/media/catalog/.htaccess 58 | /pub/media/customer/* 59 | !/pub/media/customer/.htaccess 60 | /pub/media/downloadable/* 61 | !/pub/media/downloadable/.htaccess 62 | /pub/media/favicon/* 63 | /pub/media/import/* 64 | !/pub/media/import/.htaccess 65 | /pub/media/logo/* 66 | /pub/media/custom_options/* 67 | !/pub/media/custom_options/.htaccess 68 | /pub/media/theme/* 69 | /pub/media/theme_customization/* 70 | !/pub/media/theme_customization/.htaccess 71 | /pub/media/wysiwyg/* 72 | !/pub/media/wysiwyg/.htaccess 73 | /pub/media/tmp/* 74 | !/pub/media/tmp/.htaccess 75 | /pub/media/captcha/* 76 | /pub/opt 77 | /pub/static.php 78 | /pub/static/* 79 | !/pub/static/.htaccess 80 | /pub/errors 81 | 82 | /var/* 83 | !/var/.htaccess 84 | 85 | /vendor/* 86 | !/vendor/.htaccess 87 | /vendor/ 88 | 89 | /generated/* 90 | !/generated/.htaccess 91 | 92 | /dev/* 93 | !/dev/tools 94 | /dev/tools/* 95 | !/dev/tools/grunt 96 | /dev/tools/grunt/configs/* 97 | !/dev/tools/grunt/configs/themes.js 98 | /grunt-config.json.sample 99 | 100 | /.travis.yml.sample 101 | /.user.ini 102 | /.htaccess 103 | /.htaccess.sample 104 | 105 | /CHANGELOG.md 106 | /SECURITY.md 107 | /CONTRIBUTING.md 108 | /COPYING.txt 109 | /Gruntfile.js.sample 110 | /ISSUE_TEMPLATE.md 111 | /LICENSE.txt 112 | /LICENSE_AFL.txt 113 | /nginx.conf.sample 114 | /package.json.sample 115 | /php.ini.sample 116 | /deploy.log 117 | -------------------------------------------------------------------------------- /image-snippets/admin-config-dev.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dev-jq/magento2-handy-snippets/f809227141c1cf5350ec8f5703f384f6758ed99e/image-snippets/admin-config-dev.jpg -------------------------------------------------------------------------------- /image-snippets/clean-vs-flush-cache.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dev-jq/magento2-handy-snippets/f809227141c1cf5350ec8f5703f384f6758ed99e/image-snippets/clean-vs-flush-cache.jpg -------------------------------------------------------------------------------- /image-snippets/modes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dev-jq/magento2-handy-snippets/f809227141c1cf5350ec8f5703f384f6758ed99e/image-snippets/modes.png -------------------------------------------------------------------------------- /image-snippets/upgrade-composer.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dev-jq/magento2-handy-snippets/f809227141c1cf5350ec8f5703f384f6758ed99e/image-snippets/upgrade-composer.jpg -------------------------------------------------------------------------------- /javascript.md: -------------------------------------------------------------------------------- 1 | ## :point_right: Explanation of JS files 2 | ``` 3 | jquery: The jQuery library is used in Magento for manipulating HTML elements and handling events. 4 | 5 | jquery/ui: This module contains jQuery UI-based user interface components such as dialog boxes, trees, calendars, etc. 6 | 7 | mage/adminhtml/wysiwyg/widget: This module is responsible for handling the WYSIWYG editor in the Magento admin panel. 8 | 9 | mage/adminhtml/events: This module contains the JavaScript code used in the Magento admin panel. 10 | 11 | mage/adminhtml/notification: This module is responsible for displaying notifications in the Magento admin panel. 12 | 13 | mage/adminhtml/grid: This module is responsible for handling the data table in the Magento admin panel. 14 | 15 | mage/adminhtml/browser: This module is responsible for handling the file browser in the Magento admin panel. 16 | 17 | mage/calendar: This module is responsible for handling the calendar in Magento. 18 | 19 | mage/captcha: This module is responsible for handling CAPTCHA verification in Magento. 20 | 21 | mage/checkout: This module is responsible for handling the checkout process. 22 | 23 | mage/cookies: This module is responsible for handling cookies in Magento. 24 | 25 | mage/dropdown: This module is responsible for handling dropdown menus in Magento. 26 | 27 | mage/gallery: This module contains functions for handling image galleries in Magento. 28 | 29 | mage/loader: This module is responsible for loading JavaScript and CSS files. 30 | 31 | mage/mage: This module contains functions and tools used in Magento. 32 | 33 | mage/menu: This module is responsible for handling the navigation menu in Magento. 34 | 35 | mage/requirejs/text: This module contains tools for loading text files in Magento. 36 | 37 | mage/smart-keyboard-handler: This module is responsible for handling the keyboard in Magento. 38 | 39 | mage/translate-inline: This module is responsible for live text translation in Magento. 40 | 41 | mage/translate: This module is responsible for text translation in Magento. 42 | 43 | mage/validation/validation: This module contains form validators in Magento. 44 | 45 | mage/sticky: This module is responsible for allowing elements to remain in place while scrolling in Magento. 46 | 47 | mage/collapsible: This module is responsible for handling collapsible elements in Magento. 48 | 49 | mage/ie-class-fixer: This module is responsible for fixing bugs in Internet Explorer browsers. 50 | ``` 51 | 52 | ## the most commonly used configuration options in RequireJS 53 | ``` 54 | paths: The paths configuration option allows developers to specify the locations of the JavaScript files that contain the modules they want to load. For example, if a module called myModule is located in the js directory of the application, the path can be defined as paths: { myModule: 'js/myModule' }. This option is useful when the files are not located in the same directory as the application. 55 | 56 | shim: The shim configuration option is used to define dependencies between non-AMD modules. For example, if a module called jquery is not written in the AMD format but is required by an AMD module, it can be defined as shim: { jquery: { exports: '$' } }. This tells RequireJS that jquery should be treated as an AMD module and that the $ symbol should be used as its export value. 57 | 58 | map: The map configuration option allows developers to create aliases for modules. For example, if a module called myModule depends on a module called otherModule, and otherModule has been aliased as aliasModule, the mapping can be defined as map: { 'myModule': { 'otherModule': 'aliasModule' } }. This allows developers to use more descriptive names for modules without affecting their underlying code. 59 | 60 | config: The config configuration option is used to pass configuration data to modules. For example, if a module called myModule requires a configuration object, the configuration can be defined as config: { 'myModule': { 'apiKey': '12345' } }. This configuration object can then be accessed by myModule using the requirejs.config() method. 61 | ``` 62 | 63 | ## :point_right: How to modify/extend component with mixin? 64 | Create file `app/code/Module/Vendor/view/frontend/requirejs-config.js` 65 | ``` 66 | var config = { 67 | config: { 68 | mixins: { 69 | 'Magento_Checkout/js/view/minicart': { 70 | 'Module_Vendor/js/minicart-mixin': true 71 | } 72 | } 73 | } 74 | }; 75 | ``` 76 | 77 | Then, create `app/code/Module/Vendor/view/frontend/web/js/minicart-mixin.js` 78 | ``` 79 | define([ 80 | /* [...] */ 81 | ], function() { 82 | 'use strict'; 83 | 84 | return function(target) { 85 | return target.extend({ 86 | 87 | getCartItems: function() { 88 | console.log('Mixin Component -- Before getCartItems'); 89 | 90 | var items = this._super(); 91 | 92 | console.log('Mixin Component -- After getCartItems'); 93 | console.log(items); 94 | } 95 | 96 | }); 97 | }; 98 | }); 99 | ``` 100 | 101 | ## :point_right: How to modify/extend widget with mixin? 102 | Create file `app/code/Module/Vendor/view/frontend/requirejs-config.js` 103 | ``` 104 | var config = { 105 | config: { 106 | mixins: { 107 | catalogAddToCart: { 108 | 'Magento_Catalog/js/catalog-add-to-cart-theme-mixin': true // Mixin example 109 | } 110 | } 111 | } 112 | }; 113 | ``` 114 | 115 | Then, create `app/code/Module/Vendor/view/frontend/web/js/catalog-add-to-cart-theme-mixin.js` 116 | ``` 117 | define([ 118 | 'jquery' 119 | ], function($) { 120 | 'use strict'; 121 | 122 | return function(target) { 123 | $.widget('jq.catalogAddToCart', target, { 124 | 125 | ajaxSubmit: function(form) { 126 | console.log('Mixin Widget -- Before ajaxSubmit'); 127 | 128 | this._super(form); 129 | 130 | console.log('Mixin Widget -- After ajaxSubmit'); 131 | } 132 | 133 | }); 134 | 135 | return $.jq.catalogAddToCart; 136 | }; 137 | }); 138 | ``` 139 | -------------------------------------------------------------------------------- /knockout.md: -------------------------------------------------------------------------------- 1 | # [Commomn examples](https://developer.adobe.com/commerce/frontend-core/ui-components/concepts/binding-syntax) 2 | 3 | ### how to debug knonckout variable 4 | ``` 5 |
6 | ``` 7 | ### examples 8 | ``` 9 |