In this article you will learn custom validation rule in Magento 2 form. In order to demonstrate how to get the forms to be validated, let’s create a validation-free form with some fields. Here is the simple form which consist email text field and submit button. There are three different ways to use form validation in magento 2 Way One…
Tag: #magento2
How to create Custom Magento2 less theme?
In this blog We will discuss how to create custom less theme in Magento2 ? Step 01 : Create Directory Structure in Magento 2 Theme Development Magento 2 themes are located in the /app/design/frontend folder. First, It’s necessary to create a Vendor folder and then create a theme folder inside of it. For example: /app/design/frontend/V4U/Samplelesstheme. V4U is a vendor, Samplelesstheme…
How to create Custom Magento2 theme?
In this blog We will discuss how to create custom theme in Magento2 ? Step 01 : Create Directory Structure in Magento 2 Theme Development Magento 2 themes are located in the /app/design/frontend folder. First, It’s necessary to create a Vendor folder and then create a theme folder inside of it. For example: /app/design/frontend/V4U/sampletheme. V4U is a vendor, sampletheme is…
How to use Cookie in Magento2?
In this blog We will discuss the topic of how to use Cookie in Magento2? Cookies are the most used technology for storing data on the client side. You can add below code in your phtml file or convert that code for js file also. Set cookie : To both create and retrieve a cookie, jquery.cookie uses the same method, cookie(),…
How to set Magento 2 permissions and avoid installation errors
In this tutorial you’ll learn magento 2 files and folders permission. The owner of the Magento file system: Must have full control (read/write/execute) of all files and directories. Must not be the web server user; it should be a different user. The web server user must have write access to the following files and directories: var app/etc pub generated. In…
When Composer Cannot Allocate Memory
Error : nmap() failed can no allocate memory. When Composer Cannot Allocate Memory Sollution 1 : Increasing the limit in your php.ini file (ex. /etc/php/7.2/apache2/php.ini) Sollution 2 : Now if you still run out of memory you can enable swap. sudo /bin/dd if=/dev/zero of=/var/swap.1 bs=1M count=1024 sudo /sbin/mkswap /var/swap.1 sudo /sbin/swapon /var/swap.1 The first command may take a few seconds…
How to use grunt in Magento 2?
In this tutorial, I will explain how to use grunt in Magento 2. Before starting the installation, Please rename the existing files package.json.sample and Gruntfile.js.sample in your root folder as package.json and Gruntfile.js respectively. Follow the below steps to use grunt in Magento 2 : Step 1 : Install Node.js First, we need to install a stable version of Node.js.…