Dynamic category creation

Missing categories in the product CSV file get created automatically, but only for the admin store.

  • It is strongly recommended that, by default, the value for custom-configuration-dir is <magento-install-directory>/app/etc/configuration

  • As soon as a default configuration is copied, changed, extended, or modified and stored under the path specified in custom-configuration-dir, only this configuration takes effect and always overwrites the original configuration

  • The configuration handling is mainly based on the PHP framework Symfony, and therefore unexpected effects maid occur in different configuration constellations

    • Consequently, it is always recommended to test modified configurations concerning unwanted side effects

If it is desired to disable the dynamic category creation, override the default add-update (see techdivision/import-product library), by adding the following example override snippet <custom-configuration-dir>/shortcuts.json and remove the catalog_category related operations.

{
  "shortcuts": {
    "ce": {
      "catalog_product": {
        "add-update": [
          ...
          "general/catalog_category/convert",
          "ce/catalog_category/sort",
          "ce/catalog_category/add-update",
          "ce/catalog_category/add-update.path",
          "ce/catalog_category/add-update.url-rewrite",
          "general/catalog_category/children-count",
          ...
        ]
      }
    }
  }
}
Result configuration:
The overriding result should look like this:
{
  "shortcuts": {
    "ce": {
      "catalog_product": {
        "add-update": [
          "general/general/global-data",
          "general/general/move-files",
          "general/catalog_product/collect-data",
          "general/eav_attribute/convert",
          "general/eav_attribute/add-update.options",
          "general/eav_attribute/add-update.option-values",
          "general/eav_attribute/add-update.swatch-values",
          "general/catalog_product/validate",
          "ce/catalog_product/add-update",
          "ce/catalog_product/add-update.variants",
          "ce/catalog_product/add-update.bundles",
          "ce/catalog_product/add-update.links",
          "ce/catalog_product/add-update.grouped",
          "ce/catalog_product/add-update.media",
          "general/catalog_product/add-update.msi",
          "general/catalog_product/add-update.url-rewrites"
        ]
      }
    }
  }
}

It is not possible to create categories for stores other than the admin store.

If categories get created dynamically, and the names are from the column categories, they must always be correspond to the values of the admin store.

  • Translations can be done in the Magento backend or with the category import.