How to Import Italian States in Magento

Magento 2 store owners do not get the default dropdown option that contains all the states of Italy. In online stores when forms are used, asking customers to type the name of their respective state contributes to poor user experience. On the other hand, if the developers have to write code for each registration form and include dropdown list, it is a time-consuming and tedious task. To give better user experience and easing the developer’s task, importing states to display in dropdown option is the best thing to implement. I have prepared an SQL script to import Italian states in Magento.

SQL Script to the Import Italian States in Magento:

That’s it. Feel free to use the above script to import Italian states in Magento 1 or Magento 2 development. Share this programmatic solution with the Italian store owners via social media. Buona Giornata. 😉 Thank you.]]>

How to Prevent Auto Logout When Uploading Zip File for Downloadable Product in Magento 1

prevent auto logout when uploading zip file for downloadable product in Magento 1. If you have recently upgraded your Magento 1 version, you might face this issue. While uploading the zip file for downloadable product type, you get the “uploading….” message but nothing happens. Eventually, you are returned to the admin login screen automatically. Resolve this issue using the below method:

Solution to prevent auto logout when uploading zip file for downloadable product in Magento 1:

Run the below query in database: That’s it. Any doubts about the solution can be mentioned in the Comments section below. I’d be happy to help. Also, do share the solution with Magento 1 store owners via social media. Thank you.]]>

Blog Posts How to Create Module in Magento 2

Blog Posts How to Create Module in Magento 2

Magento 2 CMS is an excellent option to develop an online store. However, it may not be enough for modern business requirements. To overcome the default limitations, there are Magento 2 extensions available in the market that extend the functionality of Magento 2. You can also opt to create module in Magento 2 rather than approaching any third party extension providers. However, you may have tons of questions regarding Magento 2 module development such as how one can develop Magento 2 module that helps the Magento 2 store to increase store facility, what are the most important things for the development of a module and so on. Well, don’t worry. Here we have prepared a comprehensive guide on creating your first Magento 2 module. To create a module or extension in Magento 2, you need to create these important files.

  1. module.xml
  2. registration.php
But, before getting started, let’s discuss some of the basic things that you need to know. The extension is built under app/code. When you go through this path, the first folder name demonstrates the name of the extension provider company. The second folder shows the name of the extension. For easy explanation, we are here giving the name of extension “Extension” and the name of a company “Meetanshi”. Alright. So coming back to the important files. What you need to do is create a file having a specific path.

Steps to create a module in Magento 2:

1. Create module.xml at app/code/Cozmot/Extension/etc  In module.xml file, copy and paste this code. Now, you also need to create a file that is registration.php. 2. Create registration.php at app/code/Cozmot/Extension These two files are mandatory to create and get started with extension development. After creating module.xml and registration.php files, the next step is to execute commands in the command line. Run these three commands and your extension will appear in app/etc/config.php. If the command gives output ‘0’, that indicates the extension is disabled. On the other hand, if the command shows output ‘1″, it explains that the extension is enabled and all the functionalities of the extension are working smoothly. Magento 2 Extension Development Guide The image explains that the name of the extension “Meetanshi_Extension” is enabled. That’s it. In the next tutorial, you will learn how to display a message on the frontend. However, if you do not want the hassle of creating an extension on your own, you can visit COZMOT for top-notch extensions developed by certified Magento developers! Do not forget to share the series of Magento 2 module development tutorials with the beginners via social media. Thank you.]]>

How to Display Table Data in Magento 2

How to Display Table Data in Magento 2

previous tutorial, you learned how to save form data to the custom table. Continuing with the same, we will This tutorial demonstrates how to display table data in Magento 2. As we have already learned how to save data to the table, let us understand how to display the saved data. All the data which you have stored can be displayed on the frontend. To do that, we need to create action so that we can display data on the frontend. The given path is an example: http://example.com/extension/index/showdata 

Programmatic Method to Display Table Data in Magento 2

1. Create a controller Showdata.php at app\code\Cozmot\Extension\Controller\Index\ 2. Create extension_index_showdata.xml at app\code\Cozmot\Extension\view\frontend\layout\ 3. Create Showdata.php at app\code\Cozmot\Extension\Block\ 4. Create showdata.phtml file at app\code\Cozmot\Extension\view\frontend\templates\ After following these four steps, you will be able to display table data. How to Display Table Data in Magento 2 Done! If you have queries regarding this blog, feel free to ask in the Comment section below. I would be happy to help you. Consider sharing this post novice Magento developer. Thank you.]]>

How to Save Form Data to the Custom Table in Magento 2

How to Save Form Data to the Custom Table in Magento 2

save form data to the custom table in Magento 2. When you fill out details in a form and click on a Submit button, the data has to be stored in a table. To do that, you will need to create Submit.php file. For instance, if you want to collect name, email addresses and telephone number of customers for sending newsletters, the data should be stored in a database. If the data is not stored in the database, we simply cannot access and send newsletters. Learn the programmatic method as shown below:

Method to Save Form Data to the Custom Table in Magento 2:

Create a file app\code\Extension\Controller\Index\Submit.php Implement the code and you will be able to save data in the database. As we have written the message “Data Saved Successfully” to display while submitting the data, the same message will appear when the data is being saved. How to Save Form Data to the Custom Table in Magento 2 That’s it. If you have queries regarding this blog, feel free to ask in the Comment section below. I will try my level best to solve your problem. Do consider sharing this blog post with the beginners who are willing to learn Magento extension development. Thank you.]]>