Magento 2 Product Position in Category: Import Guide

- E-Commerce, Magento 2

magento 2 product position in category

Today, we’d like to introduce you to the Magento 2 product positions in categories. You will learn what a product position in a category means and how to import this data to Magento 2.

When you use native Magento 2 import and export tools to transfer products to your e-commerce website, it is impossible to manage product positions inside categories, meaning you have to assign them manually, which proves to be a tedious task. However, there is a solution that addresses the existing issue. Meet the Improved Import and Export extension for Magento 2. It lets you import and export product positions using CSV, XML, XLSX, ODS, and JSON files.

In this article, you will learn how to import a product position in a category to Magento 2. We also describe the categories_position attribute, introducing you to its peculiarities. And of course, we unveil several interesting facts about the Improved Import & Export extension. But before going any further, let’s define what a Magento 2 product position in a category means.

Magento 2 Product Position in Category Defined

Every product in a category in a Magento 2 store has a certain position. The position of the products defines the order in which they are displayed on the storefront. You can leverage a product position in a category for advertising or marketing purposes, that’s why having the ability to quickly set the position for products, especially in stores with thousands of products, may save lots of management time.

Product positions in the Magento 2 administrator panel can be found under Catalog -> Categories. Here you need to choose the category you want to adjust the product positions for, and proceed to the Products in Category settings section.

magento 2 product position in category configuration

Here, in the product grid, in the Position column, you can see that Magento 2 automatically assigns product positions in a category. If you want, you can adjust these positions manually for every product in each category. This however will take much time.

With the Improved Import and Export extension, you can export existing product positions, adjust the positions according to your needs, and import products with the new positions back to your Magento 2 store. 

How to Export Magento 2 Product Position in Category

You can use the common export routine introduced in the Improved Import & Export extension to transfer category positions along with other product data. Just export products from your Magento 2 website. Note that the default export tool won’t let you get the Magento 2 product position in category data. You can find the detailed product export guide here: How to Export Magento 2 Products.

magento 2 product position in category export

How to Import Magento 2 Product Position in Category

As it has been mentioned above, you will first need to install the Improved Import & Export extension for Magento 2. The extension introduces new product attribute categories_position. The attribute is added to the general product attributes in the tables you import. Basically, you can get your old CSV tables with products saved, add a new column to them, and name it categories_position. Then you will only need to type in the proper values and you are good to go.

Below, you will find the information on how to edit the product tables and where to put the product category position value.

The categories_position Attribute – Your Only Way to Import Product Positions 

The categories_position attribute has almost the same value type as the categories attribute. First, you specify a full category path and then you type ‘=’ combined with a numeric value that represents the product position inside the category in Magento 2.

magento 2 product position in category CSV

In the screenshot above, you can see that the categories_position attribute has the same value as the categories attribute, except for ‘=4’ which is the product position in the specified category. So the value of the categories_position attribute looks like this:

Root Category/Parent category/Child category=product position

You can also specify the category path in the categories_position attribute via category IDs, for example:

1/2/3=1

In this case, the Improved Import & Export extension will trigger a check: if a category path is specified in numerals – then the extension will consider that you are using category IDs. Please note that if you are using categories that only consist of numerals – the extension will interpret such categories as category IDs.

Also, pay attention to the following peculiarities of the categories_position attribute:

  1. categories_position attribute should be added to the ‘Products’ table. It is a part of the product entity and you can only import product positions as a part of a product update: using only sku and categories_position attributes for existing products or a full set of product attributes if you are importing new products.
  2. If you have never set product positions manually in the Magento 2 administrator panel, Magento 2 will automatically set product positions to ‘0’. That’s why, if the position has never been set manually, you will get ‘0’ values for product positions when first exporting products.

That’s pretty much everything you need to know about the categories_position attribute. Now, let’s see how to import Magento 2 product positions in a category.

Magento 2 Product Import with Position in Category

With a Magento 2 Product Position in Category CSV, you can proceed to the import procedure associated with the Improved Import & Export extension. Follow these steps to import product positions in categories to Magento 2:

  1. Go to System > Improved Import / Export -> Import Jobs and press the “Add New Job” button to create a new job.
    magento 2 product position in category import jobs
  2. In the first section, specify the job name and set the job schedule if you want to import category positions to Magento automatically.
  3. Proceed to the Import Settings section. Select the entity you want to import to your Magento 2 store. As we’ve already mentioned, you need to choose Products to import product positions in a category.
    magento 2 product position in category: select entity
  4.  Then, specify the behavior of the import job. Specify the Add/Update as the import behavior.magento 2 product position in category: import behavior
  5. Now, it’s time to choose a file format and source of your Magento 2 Product Position in Category table. Note that it can be either the standard CSV format or something more specific, such as XML, JSON, ODS, or XLSX.
    When it comes to file sources, the Improved Import & Export provides the ability to import product data to Magento 2 from Google Sheets, Google Drive, over FTP/SFTP, or even via API.
    magento 2 product position in category: file format selection
  6. Once you’ve selected the file, hit the ‘Validate file’ button. If your table is correct, click the ‘Save & Run’ button followed by ‘Run’ to start the import job.
  7. Once the import is finished you will get a log with information about how the product import went.
    import magento 2 product position in category

That’s how your import product positions in categories to Magento 2. If you need to import product categories to Magento 2, follow this guide: Magento 2 Categories Import.

About Improved Import & Export

Improved Import & Export extension is a complete import-export and integration solution for your Magento 2 store. It can import and export ALL Magento 2 entities and can help you connect to your ERP and CRM software, POS systems, and dropshipping services.

Firebear team is constantly updating the extension with updates appearing almost every month. Each update brings new functionality and further enhances the extension’s functionality. 

Improved Import & Export extension features:

  • All product type support.
  • Import and export of the most common B2C and B2B entities: products and MSI, customers, cart price rules, companies, requisition, etc.
  • Bilateral synchronization via Rest and SOAP API.
  • Import and export via CSV, XML, Excel XLSX, ODS, and Json files.
  • Attribute and attribute value mappings.
  • Intuitive interface suitable for non-tech users.

You can find a full list of features on the extension’s product page.

If you want to get instructions on how to work with the Improved Import & Export extension and see the full process – read the extension manual.

Also, note that this article is a part of the Firebear Magento 2 import and export Guide List, which covers ALL entities, and all import and export procedures and peculiarities that you need to know. Visit the Magento 2 import and export Guide List reference page to find out how to import a particular entity to Magento 2.

Read Magento 2 import and export Guide List

Magento 2 Product Category Position Import FAQ

Below, you can see other tips on how to manage Magento 2 product category positions in your admin.

How to import product category positions to Magento 2 automatically?

If your business case requires transferring product category positions or other entities to Magento 2 regularly, use the Improved Import & Export extension. The module provides the ability to leverage the cron scheduler to plan future product updates.

How to import Magento 2 product position in a category from external systems?

With the Improved Import & Export Magento 2 extension, you can effortlessly transfer products along with their category positions between two Magento 2 websites or from external systems. Unlike the default Magento 2 import solution that doesn’t let you transfer third-party data, our module provides the ability to teach your e-commerce store how to react to unknown data. You create a mapping scheme and match any external attributes to the default ones used in Magento 2. It is possible to match attribute values including product category positions.

How to import product category positions to Magento 2 via API?

By default, Magento 2 doesn’t let you move any data via API. However, you can use the Improved Import & Export extension to transfer all the desired entities along with products and their category positions to Magento 2 via API.

How to import Magento 2 product position in a category via ODS files?

If you use ODS files to store product category positions, the Improved Import & Export Magento 2 extension will help you move them to your e-commerce website. While Magento 2 works with CSV files only, our module exceeds the existing limitations by adding support for other file formats.

How to import product category positions to Magento 2 via XLSX files?

If you use XLSX files to store product category positions, the Improved Import & Export Magento 2 extension will help you move them to your e-commerce website. While Magento 2 works with CSV files only, our module exceeds the existing limitations by adding support for other file formats.

How to import Magento 2 product position in a category via JSON files?

If you use JSON files to store product category positions, the Improved Import & Export Magento 2 extension will help you transfer them to your e-commerce website. While Magento 2 works with CSV files only, our module exceeds the existing limitations by adding support for other file formats.

How to import product category positions to Magento 2 via compressed files?

If product category positions are compressed, you can also use Improved Import & Export to transfer them to Magento 2. Note that the extension supports ZIP or TAR archives that contain a CSV, XML, ODS, XLSX, or JSON file.

How to import product category positions to Magento 2 from Google Sheets?

If your product data along with product category positions is stored in Google Sheets, it is no longer an unsolvable problem. You can use the Improved Import & Export extension to transfer this information to Magento 2. It is only necessary to specify the corresponding table as your import source, providing its URL.

How to import product category positions to Magento 2 from Dropbox?

The Improved Import & Export extension lets you transfer product category positions to Magento 2 from Dropbox along with Google Sheets and other file sources. The data should be stored as CSV, XML, ODS, XLSX, or JSON files. Also, note that it should be a ZIP or TAR format when it comes to compressed files.

How to import Magento 2 product position in a category from Google Drive?

The module also lets you transfer product category positions to Magento 2 from Dropbox. The requirements are simple: save your product data as CSV, XML, ODS, XLSX, or JSON files. If you need to compress them, use ZIP or TAR formats.

How to match external categories to the categories used in Magento 2 while importing products?

The Improved Import & Export Magento 2 module can match any external categories to the ones used in your catalog. Thus, the extension provides the ability to transfer product category positions and replace external categories with the ones you already use on your website. You only need to choose an external category and specify the replacement. Furthermore, the module enables you to create the missing categories on the fly and direct the external ones to the newly generated records.

Final Words

Magento 2 product positions in a category represent a useful addition to the catalog. You can use this feature to promote certain goods or keep your categories in order. With the Improved Import & Export extension, it is even possible to import and export product positions in categories to avoid manual editing. Follow this link to learn more about our extension:

Get Improved Import & Export Magento 2 Extension