Today I am going to show you how we can get customer by email in Magento 2 If you need to get customer in Controller, Block, Helper or Observer then please follow the code If you wan’t to get customer in .phtml file then follow the code
Magento 2.x
How to check customer is logged in or not In Magento 2.x ?
Today I am going to show you how we can check customer is logged in or not on Magento 2 Two ways We can check customer is logged is or not. 1. Using Magento\Customer\Model\Session object If you need to check in Controller, Block, Helper or Observer then please follow the code If you wan’t to… Continue reading How to check customer is logged in or not In Magento 2.x ?
How to create custom knockout js component in Magento 2.x
Knockout js is javascript library. Magento use knockout js most of pages. Magento 2.x checkout all section developed using knockout js. Today we create a simple knockout js module in Magento 2. We display a simple message using the custom knockout js component. Let’s start by creating a simple knockout module. Step1. Create module directory… Continue reading How to create custom knockout js component in Magento 2.x
How to create custom command in Magento 2.x
Today we going to create a new custom CLI command in Magento 2.x Console command is usefull to run you program from CLI. We will going to create new CLI command in magento 2.x. Magento 2 provide so many CLI commands, We will add our custom CLI commnad in Magento 2. It’s very simple to… Continue reading How to create custom command in Magento 2.x
How to create custom cron in Magento 2
Today we going to create a custom cronjob module in Magento 2.x Cronjob is run automatically on the server, based on a specific time. If we require to run some code frequently then need to create cron job for that code. Cronjob runs your code as given your scheduled time. Magento also supports cronjob. This… Continue reading How to create custom cron in Magento 2
How to create product attribute in Magento 2.x using InstallData.php
Today we create a module for creating product attribute in Magento 2. This blog is for Magento 2.x product attribute. How we can create attribute using our custom module. Let’s start by creating a custom attribute module. Go to the Magento app/code directory and create a directory with your vendor name. My vendor name is… Continue reading How to create product attribute in Magento 2.x using InstallData.php
How to create a custom module in Magento 2.x
Today we create a simple module in Magento 2. We display a simple message using the controller and using a custom layout. For display messages using a custom layout, we will need to create a custom frontend layout file in our module. Let’s start by creating a simple module. Step1. Create module directory Go to… Continue reading How to create a custom module in Magento 2.x