How to Import and Export Customer Data in Magento 2

How to Import and Export Customer Data in Magento 2

Magento 2 allows the merchant to import and export customers.

Steps to Import and Export Customer Data in Magento 2

First, let us understand how to export customers.

How to Export Customer Data in Magento 2

How to Import and Export Customer Data in Magento 2
  1. Log in to Magento 2 admin panel
  2. Navigate to System > Data Transfer > Export
  3. Under Export Settings, select Customers Main File in Entity Type
  4. The Export File Format is CSV by default
  5. In Entity Attribute, select choose the attribute that you want to exclude from CSV file
  6. Click ContinueHow to Import and Export Customer Data in Magento 2 - CSV file
  7. Here is CSV file having customer data.

How to Import Customer Data in Magento 2

How to Import and Export Customer Data in Magento 2 - CSV file Now, let us add customer data in the CSV list and import the file.
  1. Log in to Magento 2 admin panel
  2. Navigate to System > Data Transfer > Import
  3. In Entity Type, select Customer Main FileHow to Import Customer Data in Magento 2
  4. Select the Add/Update Complex Data in Import Behavior
  5. Go to Choose File in Select File to ImportHow to Import Customer Data in Magento 2
  6. Click Check Data 
That’s it. The customer data is imported. If you need more help regarding this blog, feel comfortable for asking in the Comment section below. I would be happy to solve your queries. Please do consider sharing this blog with Magento Community via social media. Thank you.]]>


Deprecated: pathinfo(): Passing null to parameter #1 ($path) of type string is deprecated in /var/www/html/wp-content/plugins/urvanov-syntax-highlighter/class-urvanov-syntax-highlighter-langs.php on line 86

How to Add Custom Layout to CMS Pages in Magento 2


Deprecated: pathinfo(): Passing null to parameter #1 ($path) of type string is deprecated in /var/www/html/wp-content/plugins/urvanov-syntax-highlighter/class-urvanov-syntax-highlighter-langs.php on line 86

app/design/frontend/_YOUR_VENDOR_/_YOUR_THEME_/Magento_CMS/layout/cms_page_view.xml and Content:

]]>


Deprecated: pathinfo(): Passing null to parameter #1 ($path) of type string is deprecated in /var/www/html/wp-content/plugins/urvanov-syntax-highlighter/class-urvanov-syntax-highlighter-langs.php on line 86

Deprecated: pathinfo(): Passing null to parameter #1 ($path) of type string is deprecated in /var/www/html/wp-content/plugins/urvanov-syntax-highlighter/class-urvanov-syntax-highlighter-langs.php on line 86

How to Count Post Views in WordPress without Plugin


Deprecated: pathinfo(): Passing null to parameter #1 ($path) of type string is deprecated in /var/www/html/wp-content/plugins/urvanov-syntax-highlighter/class-urvanov-syntax-highlighter-langs.php on line 86

Deprecated: pathinfo(): Passing null to parameter #1 ($path) of type string is deprecated in /var/www/html/wp-content/plugins/urvanov-syntax-highlighter/class-urvanov-syntax-highlighter-langs.php on line 86


2. Then, copy the code below and paste it into single.php file in the while loop.


3. Next, copy the following code and paste it where you want to show the number of views
<div class=”densorstyle=””><?= gt_get_post_view(); ?></div>
4. When it’s all done, you will see the post view like this:]]>

How to Fix Unique Constraint Violation Found in Magento 2

How to Fix Unique Constraint Violation Found in Magento 2

Unique Constraint Violation Found in Magento 2 You may have got integrity constraint violation error while creating an order from the backend in Magento 2 store. When you face this error, it means that a duplicate value is created in the database table. Here’s the solution to fix unique constraint violation in Magento 2 admin panel.

Steps to Fix Unique Constraint Violation Found in Magento 2:

Check the table “sequence_order_1” where 1 refers to the store id. sequence_order_1 In the above table, the sequence_value column should be auto_increment to fix the integrity constraint violation in Magento 2. That’s it. Any doubts about the error and its solution can be mentioned in the Comments section below. I’d be happy to help. Do share the solution with the Magento Community via social media. Thank you.]]>

How to Create Block and Template in Magento 2

How to Create Block and Template in Magento 2

 create a block and template file in Magento 2. When we want to display content using an action method, we need to create a block and template file. Block file has functions that we use in a template file. Moreover, the template also includes the content that has code related to HTML and PHP. The XML file for layout demonstrates which block and which template file will be called. Another important thing to keep that in mind is that you have to create a layout file based on the action that you have developed. We will continue with the same example that we discussed in the previous tutorial. Therefore, we have to create a file having extension_index_index.xml name. You may have a question why the XML file is created with a name of extension_index_index.xml. It is because the action that we developed was extension/index/index.

Method to Create Block Template in Magento 2

1. Update Controller File:

Earlier, the message was just printed. Now, what we are doing is to print a message with a page. To do this, we have to update the code in a file app/code/Meetanshi/Extension/Controller/Index/Index.php

2. Create a Block File:

For creating a block file, give the name Form.php and create this file in a given path. app\code\Meetanshi\Extension\Block\Form.php

3. Create a Template File:

Creating a template file is extremely simple. Save form.phtml with the given code below and use the path for creating the file. app\code\Meetanshi\Extension\view\frontend\templates\form.phtml

4. Create a Layout File:

The last and the final file that you need to create a block template is the layout file. Make sure, the name of your layout file has to be extension_index_index.xml. In the given path, use the code and save the file. app\code\Meetanshi\Extension\view\frontend\layout\extension_index_index.xml You can check which block file and template file are being called. Here is how the output looks on the frontend Here is how the output looks on the frontend. As you can see in the below image, the output now shows header and footer. Also, Luma is a default theme of Magento 2. Therefore, you will see Luma theme for the output of your extension. That’s it. If you have questions, feel free to ask in the Comment section below. Do share this post to beginner and passionate who wants to learn Magento extension development. Thank you.]]>