How to ask user for confirmation in Magento 2 console commandThis is a short post showing how to ask user for the confirmation when running Magento 2 console command. The typical use case for this is “Are you sure you want to continue?..#magento2 #snippet
Rendering the Magento 2 console command output as a tableHere is a quick example of how to render the Magento 2 console command output as a table. This can be useful in a number of situations where the resulting data is tabular...#magento2 #snippet
Returning JSON response from Magento controller actionHere’s quick example of how to return JSON response from Magento controller action. Assuming you have already created appropriate XML configuration and controller class/file, just add the following code to your action:..#magento #snippet
Hosting Ghost blog with Nginx - config example with www redirect and SSL by LetsEncryptHere’s a sample Nginx configuration for Ghost blogging platform, that includes: 1) standard proxy configuration to successfuly host Ghost blog; 2) redirect “www” to “non-www” website; 3) use “https” over “http” website;..#server #snippet
Load customer by custom attribute in MagentoHere is an example of slightly more advanced approach of how to load customer in Magento - load customer by attribute value - be it some default attribute or a custom one...#magento #snippet
Load customer by email in MagentoAnother example of how to load customer in Magento - this time - by customer email. Previously we looked at how to load customer by ID in Magento, now we will do the same, but using the customer email address...#magento #snippet
Load customer by ID in MagentoHere is a quick example of how to load customer by its ID in Magento. It is a standard load method that is used across all Magento models...#magento #snippet
Get current store ID in MagentoThis here is a really short example of how to retrieve current store ID in Magento. Additionally to that, an example of getting current store object and some of its data...#magento #snippet
Small collection of useful SASS mixinsI happen to use these little SASS mixins quite often, but did not have Gist created yet. So I decided to create a small collection for quick copy and easy lookup next time I need them...#misc #snippet