Select Page

Setting up the Akeneo Connector in Magento 2: Part 3 – Filtering the Import Data

April 30, 2021

The Magento 2 connector for Akeneo is a powerful tool to easily integrate your Akeneo implementation with your Magento 2 ecommerce store. This article outlines some of the more advanced filtering you can do with this connector. If you are looking for information about setting up the connector or running the jobs see Part 1 and Part 2 of this series. Configuration for the connector is found in the Magento Admin Panel at Stores > Settings > Configuration > Catalog > Akeneo Connector. Here you will find the Filter productsCategories, and Attributes menus. Each of these menus allows you to add some extra controls on how your Magento 2 data is formatting.

First is the Filter products menu. This menu allows you to control which products flow into Magento 2 from Akeneo. There are 2 modes that can be selected from the Mode dropdown. Advanced mode allows the admin to provide filtering criteria via JSON. This can be helpful if you want to filter on something that isn’t available through Standard filters. The trade-off is that this method does require some technical knowledge. If you have any formatting mistakes in your JSON query the entire filter will fail. As a result I recommend first trying to use the Standard filtering.

With Standard filtering you can filter based on completeness, status, updated date, and family. Completeness filtering is managed with 3 fields.

The first completeness field is Product Completeness type. This field chooses the comparison operator you’ll be using for completeness. You can choose to match completeness less than, greater than, equal to, or not equal to a specific percentage. You can also choose to perform this comparison on a single locale or all locales. 

The next field, Product Completeness value, is the completeness value you’re comparing to. For example if you choose “Greater or equal than” for Product Completeness type and enter “80” for Product Completeness value all products in Akeneo that have 80% or more completeness on any locale will be pulled into Magento 2.

Lastly, Product Model Completeness type allows for additional filtering for product models. Remember, product models are many “variant” products linked by a set of common attribute values. If you select “At least one variant complete” or “At least one variant incomplete” all variants for a product model will be synced when 1 variant meets the completeness criteria. If instead you select “All variants complete” or “All variants incomplete” the variants will only sync when every variant meets the completeness criteria.

The Status field allows you to sync only Enabled or Disabled products. Updated mode allows you to filter on the “Updated at” Akeneo value. Use this to filter products updated before, after, or between specific dates or after X number of days. The Updated field is the date or number of days that you use to compare against. If you select “Since last X days” for Updated mode and enter 3 for Updated, each time you run the Product job only those products updated in the past 3 days will sync. This is a good way to reduce processing time for your connector. Finally, you can provide a list of Akeneo family codes to the Families field to exclude products in specific families from being synced. If the field is left black all families will be synced.

The next menu, Categories, provides some configuration and filtering for Akeneo categories. With the Activate new categories field categories can be set to be activated by default. The Include new categories in menu field will set new categories to be included in the menu by default. Selecting Set new categories in anchor mode will place new categories in anchor mode by default. Providing a list of categories to the Categories field will prevent those categories from being added to Magento 2. Note that this will only exclude the categories from the Category job. It will not prevent products from those categories from being pulled.

You can also add filtering to families in the Filter Families menu. This menu only has 2 fields Updated mode and Updated after. Similar to how you could filter products on their “Updated at” value, you can also choose to only update families updated after a specific date. Note that as of the time of writing Update mode only has the option “Greater than”.

The Attributes menu provides unique attribute type mapping customization. This menu contains a single Additional types field. This field allows you to change the default mapping for attribute types. By default the connector will make logical mappings for Akeneo attribute types into Magento. Text in Akeneo becomes a Text field in Magento, Simple Select in Akeneo becomes a Dropdown field in Magento, etc. For a full list of attribute type mapping see the official Akeneo documentation. If, for example, you’d like your Simple Selects to be represented as Text values rather than a Dropdown you can add that mapping into the Attributes table.

The final menu covered in this article is the Filter Attributes menu. The first 2 fields Updated mode and Updated after are functionally identical to those in the Filter Families menu. They allow you to only import attributes that have been updated after a specific date. If “Yes” is selected for the field Filter by attribute code the final field Attribute codes to import. Unlike other fields of this type, you must list all attribute codes that you wish to import. Attributes with codes not listed in the field will not be imported. This is the opposite of how categories and products work, so be careful.

You should now feel confident setting up the more advanced configuration options for the Akeneo Magento 2 connector. Stay tuned for Part 4 where I’ll be covering the final configuration section, Products.

You May Also Like…